Copy link to clipboard
Copied
Is it possible to add a SESSION VARIABLE at the same time as one operates a "Go Back" link?
My site covers information for three towns. The names of the towns are the possible SESSION VARIABLES. In the absense of a SESSION VARIABLE I plan to divert to a page where the user selects a town form the list of three links. I am trying to make this link add the selected town-name as a SESSION VARIABLE and also operate the "Go Back" link so that the target page now receives a SESSION VARIABLE.
I tend to use php and in this case I am making use of a Go Back javascript, but cannot work out quite how to make it work, or if it is possible.
I'm using DWmx2004.
Copy link to clipboard
Copied
The JavaScript "go back" operates client-side (i.e., solely in the browser). Creating a session variable needs to be done by PHP, which is a server-side language. You can't do it without submitting something to the server to create the session variable.
Copy link to clipboard
Copied
You can use javascript to save info on a cookie and use go back button. Then you can use the info from the cookie to write to session variable on the page you went back to. Depending on what you're doing there may be security issues involved using this method.
Copy link to clipboard
Copied
Thanks for the ideas.
DWFAQ.info wrote:
You can use javascript to save info on a cookie and use go back button. Then you can use the info from the cookie to write to session variable on the page you went back to. Depending on what you're doing there may be security issues involved using this method.
That sounds interesting. Security is not an issue here, but I've not used cookies before. Could you either explain how that would be done, or point me to an explanation (and example) somewhere, please?
Copy link to clipboard
Copied
The methods involved are beyond the scope of this discussion but the terms mentioned should be enough to search and find a solution on your own accord.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now