Doubt about 'Session'
-
When a client is connected with the server, a session is assigned with that client uniquely, now a sessionID is stored as cookie on the client's system. Now, i m trying to check the value of this ID, as
Session.SessionID
but, each time the page is re-loaded, the ID changes .... ! Why does the ID change ? Is there anything wrong in my code, or the ID actually changes when the page is re-loaded ??? -
When a client is connected with the server, a session is assigned with that client uniquely, now a sessionID is stored as cookie on the client's system. Now, i m trying to check the value of this ID, as
Session.SessionID
but, each time the page is re-loaded, the ID changes .... ! Why does the ID change ? Is there anything wrong in my code, or the ID actually changes when the page is re-loaded ???i thinkkk sesssiion closes after u reload and new session is created check out ur code properly
-
When a client is connected with the server, a session is assigned with that client uniquely, now a sessionID is stored as cookie on the client's system. Now, i m trying to check the value of this ID, as
Session.SessionID
but, each time the page is re-loaded, the ID changes .... ! Why does the ID change ? Is there anything wrong in my code, or the ID actually changes when the page is re-loaded ???You're storing a cookie ? I don't believe the session does this by default. One good thing about the Session is that, unlike cookies, the user cannot turn it off.
Christian Graus Please read this if you don't understand the answer I've given you. If you're still stuck, ask me for more information.
-
i thinkkk sesssiion closes after u reload and new session is created check out ur code properly
my code,
protected void Page_Load(object sender, EventArgs e)
{
System.Windows.Forms.MessageBox.Show(Session.SessionID.ToString());
}The above code shows a message box with the current Session ID.
-
You're storing a cookie ? I don't believe the session does this by default. One good thing about the Session is that, unlike cookies, the user cannot turn it off.
Christian Graus Please read this if you don't understand the answer I've given you. If you're still stuck, ask me for more information.
na ... i am not storing any cookie ...!
-
When a client is connected with the server, a session is assigned with that client uniquely, now a sessionID is stored as cookie on the client's system. Now, i m trying to check the value of this ID, as
Session.SessionID
but, each time the page is re-loaded, the ID changes .... ! Why does the ID change ? Is there anything wrong in my code, or the ID actually changes when the page is re-loaded ???I have tested that (posted) code for both IE 6.0 and Firefox 2.0 Both are showing similar behavior !!!! :confused: :confused: :confused: :confused: :confused: :confused: :confused:
-
When a client is connected with the server, a session is assigned with that client uniquely, now a sessionID is stored as cookie on the client's system. Now, i m trying to check the value of this ID, as
Session.SessionID
but, each time the page is re-loaded, the ID changes .... ! Why does the ID change ? Is there anything wrong in my code, or the ID actually changes when the page is re-loaded ???Try to replicate this issue in an empty web app. If it occurs, then the problem is with your server's configuration (machine.config). If not, the problem is only application-level. My guess is that this is the case: see if you have a really low session Timeout set, or if you have a Session.Abandon() command somewhere in your program.
-
Try to replicate this issue in an empty web app. If it occurs, then the problem is with your server's configuration (machine.config). If not, the problem is only application-level. My guess is that this is the case: see if you have a really low session Timeout set, or if you have a Session.Abandon() command somewhere in your program.
Steve Westbrook wrote:
Try to replicate this issue in an empty web app
the code i shwon is of an empty web-app.
Steve Westbrook wrote:
server's configuration (machine.config)
how to fix it ?
Steve Westbrook wrote:
low session Timeout set,
i m not changing, so the default 20min shall be there...
Steve Westbrook wrote:
Session.Abandon()
na .. it is not the case. What is the result of 'that' code on your machine ? :confused: