Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Session Variable is Null

Status
Not open for further replies.

richwms

Programmer
Jun 7, 2012
1
US
I am using the following code in the header of the pages on a web site: Session("backPage") = curPageURL()
I want to capture the URL of the page the user is looking at.
Then when they click on a link on the header, it transfers them to another page. When they are finished with the page, I want to transfer them back to the prior page the user was looking at.
When I do a Response.Write "backPage=" & Session("backPage") in the header, the actual URL is displayed. However when I do a Response.Write "backPage=" & Session("backPage") on the linked to page, I get a null value. What am I missing?
Regards, Richard
 
No idea, are you reinitialising the session variables on loading the next URL?

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
It looks like you are trying to assign a client side (javascript) value to a server side session variable which as I understand is never going to work.

The way I got round to this was to write a little AJAX function to POST the current URL off to my ASP code which would write it to a database (or in your case assign it to a session variable).

If you want more help along these lines let me know.

Thanks

Ed
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top