Session problem

  • Thread starter Thread starter Uzi Baruch
  • Start date Start date
U

Uzi Baruch

Hi!



Is there an embedded way to check if a session ends?



i have an standard ASP.NET application and i want to check if the session
has expired on every "Click" that the user did, and force him to login when
the session no longer exists.



Thanks,

Uzi
 
Uzi Baruch said:
Hi!



Is there an embedded way to check if a session ends?



i have an standard ASP.NET application and i want to check if the session
has expired on every "Click" that the user did, and force him to login when
the session no longer exists.



Thanks,

Uzi

There is a Session.IsNewSession property, but simpler would be to store the
login-status
in some session-variable and redirect to your login-page if that variable
does not exist.

Hans Kesting
 
But that requires me to check it all the time, and that’s what I’m trying to
avoid.



i need something generic, built in the page, I thought of inheriting all the
pages from my own page, and on the base page load the is the session ended,
does that sound like a good idea ?



Thanks,

Uzi
 
In web.config there is an <authentication> section that you could use.
Sorry, I have never used that so I can't help you further.

Hans Kesting
 
i have an standard ASP.NET application and i want to check if the session
has expired on every "Click" that the user did, and force him to login when
the session no longer exists.

In your case, it's a simple matter of setting a Session variable when the
user fills out the login page successfully. All you have to do is check for
the existence of that Session variable. If it doesn't exist, the user has to
log in.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
Back
Top