asp.net session expiration

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

it seems that a session in asp.net sometimes expires before its time is
supposed to expire? so for example i developed a client side that relies on a

if Session("Var") > 0 then

else
end if

to verify that a user is logged in with proper credentials. now sometimes
the session expires before the twenty minute mark and kicks the user out of
the client side because the Session("Var") is no longer > 0. can someone tell
me why this is happening?
 
First off, you should be explicitly casting the session variable to an
integer.You should turn Option Strict On, so that you are reminded of this.

It's hard to say why session would end. Most often it is related to the
ASP.NET process restarting when someone changes web.config, something in the
bin directory, restarts IIS, etc.
 
the code i posted was just an eg. its not actually what is written. The web
config file nor the /bin dir are changed and therefore did not cause any
restart.
 
Back
Top