Getting new session ID on each refresh!!!!

  • Thread starter Thread starter Edward Yang
  • Start date Start date
E

Edward Yang

I am getting a new session id on each refresh.

This is not the first time I have this problem. I have had this problem
with ASP.NET 1.0/1.1, and now with 2.0 beta 1.

The page is simple enough, which has:

void Page_Load(object sender, EventArgs e)
{
this.Title = Session.SessionID;
}

On each refresh (F5), it gives a different session ID! So everything
bascially not working in this way (especially session data).

I don't know the exact reason that is causing this.

Can Microsoft guys look into issue? Though this does not happen always,
but once it happens, it will be a nightmare!!!
 
this would normally happen if the client rejects the session cookie. ie if
the server cannot retrieve session info from the client it will create a new
instance for that client.

if you see it persistantly then make sure the client browser accepts cookies
from you site. otherwise consider using cookieless session info (adds
session info to the querystring).

--

Regards,

Hermit Dave (D'way)
http://hdave.blogspot.com
 
What if you try to actually create a session variable ?

Could it be because ASP.NET doesn't bother to maintain the session without
at least one session variable defined ?

Patrice
 
Hermit said:
this would normally happen if the client rejects the session cookie. ie if
the server cannot retrieve session info from the client it will create a new
instance for that client.

if you see it persistantly then make sure the client browser accepts cookies
from you site. otherwise consider using cookieless session info (adds
session info to the querystring).
Sorry, that's not the case.

It works 99.9999% of the time, but it did happen.
 
Back
Top