views:

60

answers:

4

On PageA.asp I set a session variable like so

Session("affiliate") = "xyz.com"

When I click a link and go to PageB.asp that session variable no longer exists.

I have other session variables and they persist across the pages. I can response.write my session varriable on PageA.asp, so I know it gets created properly.

I had this problem a few months back. I figured it out then, sometime between now and then my fix got overwritten. Now, I'm at a total loss.

Thanks in advance.

+1  A: 

You're probably clearing the variable somewhere else in your site.

SLaks
It's weird on pageA there are roughly 20 session variables.On pageB there are roughly 12 session variables.Where do those 8 session variables go?
s15199d
each session variable takes 5kb+ multiplying by 20 is 0.5mb for each browser. maybe you dont have enough memory on your server and some variables are getting lost.. are they always the same to be lost? or is it changing from time to time?
Noam Smadja
A: 

Is PageB.asp on the same domain? cross domain sessions will not work. Same domain sessions should not clear unless you are resetting it or clearing the contents.

Do you have the code where you populate the session?

c14kaa
he said other session variables are working.. so we guess it is on the same domain.. but question was asked as if not really willing for an answer..
Noam Smadja
A: 

if other session variables are still usable on PageB.asp than this should work as well..

UNLESS,

  1. youve set it to expire to fast.
  2. you have a typo in the session variable name on pageB.asp. copy paste from pageA to pageB.

without seeing the code related to the session variables from pageA and pageB its quite hard to guess..

as for your comment regarding the loss of session variables try:

<%
dim i
For Each i in Session.StaticObjects
  Response.Write(i & "<br />")
Next
%>

this should list all the objects stored in session

Noam Smadja
A: 

No matter what I did, the session variable was getting lost on response.redirects. I ended up using a cookie.

s15199d