470,848 Members | 2,530 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,848 developers. It's quick & easy.

Session Time Out

hi,

I have one task, i want to show some information on my web page "Your Session has completed please login again",when the Session time out.

thanks,
Shirish.
Jun 4 '08 #1
2 977
Plater
7,872 Expert 4TB
You should be checking your session validity at each page load. If its not valid, you can redirect them to a page with that message?
Jun 4 '08 #2
In my login pages, I generally add a session state variable. When the session times out, this variable will no longer exist. I call this method the Page_Load from all the pages in my last web app. You don't need it to do it in a static method, though, but I thought it might illustrate the necessary objects for you.

public static void checklogin(HttpSessionState s,Page r)
{
if (s["FullName"]==null)
{
s.Add("SessionExpired","true");
r.Response.Redirect("login.aspx");
}
}
Jun 5 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

27 posts views Thread by mrbog | last post: by
30 posts views Thread by Robert Tweed | last post: by
11 posts views Thread by Vishal | last post: by
5 posts views Thread by Just D. | last post: by
17 posts views Thread by jensen bredal | last post: by
13 posts views Thread by Alexander Widera | last post: by
10 posts views Thread by tshad | last post: by
8 posts views Thread by ari | last post: by
7 posts views Thread by Mr Newbie | last post: by
25 posts views Thread by =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.