Visual Studio .NET - How to handle session state events..?

Asked By hitesh kumar
28-May-07 10:20 AM

Hi,

I am trying to handle the Session.Timeout[..] event in the .aspx page and want to display a message, before the session got expired "That your session will be expire in 5 minutes"

can any body help me out.?

Hitesh Kumar

 

Session normally has a sliding expiration.  Session normally has a sliding expiration.

28-May-07 02:45 PM

So if you have Session timeout set for 30 minutes, if a user sits with the same page in their browser for 29 minutes and does nothing, and then requests a new page, they now have another 30 minutes of Session.

Does that help? Everything about Session works when a page is requested. Therefore, the concept of "notifying" a user that their session is "about to timeout" is a moot point.

Hi sir,  Hi sir,

29-May-07 12:06 AM

Hi,

I know that session works when a page is requested,but actually what i want to do when 5 mintutes left to expire the Session,I just want to display a message to user "That your session get expired in 5 minutes" when he does nothing.

It is a kind of buzz! to user...

so,how could i use Session.TimeOut[..] in .aspx page?

(Hitesh Kumar)

Thanks

 

Use HTML/Javascript for a   Use HTML/Javascript for a "hybrid" solution...

29-May-07 06:16 PM
If you want to "buzz" the user to see if they're still around (my old bank site did this), you're going to have to use Javascript to have a Timeout feature. If your Session timeout is 30 minutes, your Javascript needs to fire off in 25 minutes with its alert box.

In a related note to all of this, don't forget you have the server DLL processing your app and the client code being generated. To keep a "robust" timeout in place, you need to put any necessary code in your Session_Timeout method of the Global.asax, and then use HTTP meta tags, Javascript, ClientRegisterScriptBlock to make the web page itself do your timeout functioning. I typically have a logout page that the user is redirected to via a script registration block once the allotted time is reached. I keep this value in my web.config file.

That way, after 30 minutes have expired, the proper session abandonment happens behind the scenes and the client page is redirected to a logout page to avoid any kind of confusion.
hi sir,  hi sir,
30-May-07 02:48 AM

Thanks a lot sir.

I think this will help me out...

Thanks

(Hitesh Kumar)

Create New Account
help
Visual Studio .net .NET Framework Hi NG, ich habe vor längerer Zeit mit Visual Studio .Net 2003 gearbeitet und überlege momentan auf einen neueren Stand upzudaten. Ein Visual Studio .Net 2008 scheint es nicht zu geben. Habe zumindest mit googeln nichts gefunden. Was
Wise for Visual Studio.NET Wise for Visual Studio.NET By Peter A. Bromberg, Ph.D. To "Print This Page" Link Peter Bromberg Wise for Visual Studio .NET is a total and complete installation development system for creating and editing Windows® Installer
Visual Studio versioning . . . . how to tell? .NET Framework To my knowledge, Visual studio 6 was released in 1998, then Visual Studio .NET 2002 is VS 7, then Visual Studio .NET 2003 is VS 7.1, then Visual
visual studio.net 2003 and Access 2007 database .NET Framework Hi I am currently using Visual Studio.Net 2003 running on Windows Server 2000 operating system. I have used Visual Studio.net 2003 connecting to Access 2002 databases in the pass with great success. Now
Is Visual Studio self-hosting ? .NET Framework Does Microsoft use Visual Studio IDE, Visual Studio Debugger, Visual Studio Linker and Visual Studio compiler for developing Visual Studio ? Or is Visual Studio not