Session problem

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
 
H

Hans Kesting

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
 
U

Uzi Baruch

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
 
H

Hans Kesting

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
 
K

Kevin Spencer

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top