I've been asked to do the site search. The search form
has 12-15 form fields, on form submission, I'm passing
the form field values in a query string to the action
page. I read the url variables from the query string
and pass them to the sql database and display the
results.
I've done this and it all works fine. I am have now
been asked to apply some logic to allow a user who
after performing a search and seeing the results
decides to go to some other page on the site and then
decides to return to the search results page, he
should be displayed the search results of the search
he performed earlier.
Hope this is making sense. I have written some code
which loops through the url variables on the action
page when the search is perfomed and dynamically
creates session variables to store the values in the
session scope. Here is the code.
<cfif isDefined("url.SEARCHBUTTON") and
url.SEARCHBUTTON eq "clicked">
<cfloop collection="#url#" item="iUrl">
<cfif url[iURL] neq "">
<cflock scope="SESSION" timeout="30"
type="EXCLUSIVE">
<cfset "session.searchresults.#iUrl#" = "#url[iURL]#">
</cflock>
</cfif>
</cfloop>
<cfloop collection="#session.searchresults#"
item="sessionVar">
<cfset "url.#sessionVar#" =
"#session.searchresults[sessionVar]#">
</cfloop>
</cfif>
I see the session variables and values in the
session.searchrsesults scope when I dump this on the
results page when the user performs a search.
However I don't see any session variables or values in
the session.searchresults scope when the user returns
to the search results page after visiting another
page. Why is it that the session variables not being
persistent? Please can somebody help
Best Regards
cfcoder
__________________________________
Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.
http://antispam.yahoo.com/tools
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

