Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / August 2007

Tip: Looking for answers? Try searching our database.

Questions About Session Timeout

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Joey - 30 Aug 2007 14:23 GMT
I have an asp.net 2.0 app written in C# and VS2005. I sometimes have
issues where users leave a page onscreen and then come back to it a
few hours later and try to continue working. Of course, it doesn't
work then. Currently they will encounter some sort of error message
because the session has timed out.

I need to develop a way to handle this!

Some questions:

1) If I want to set my session to timeout at 30 minutes, what should i
set for session timeout both in IIS config and in the web.config file,
for forms authentication.

2) When I am using my online banking website, my webpage automatically
logs me out after a set amount of time. How do I do that with my code?

Thanks in advance for your help!
Hans Kesting - 30 Aug 2007 14:33 GMT
> I have an asp.net 2.0 app written in C# and VS2005. I sometimes have
> issues where users leave a page onscreen and then come back to it a
[quoted text clipped - 5 lines]
>
> Some questions:

> 2) When I am using my online banking website, my webpage automatically
> logs me out after a set amount of time. How do I do that with my code?
>
> Thanks in advance for your help!

You can have a javascript timer in your html page, that redirects to some
"session expired" page after the session should have timed out.
Just be careful: the session timeout is in minutes and javascript
works in milliseconds.
It's not possible to wire up some "SessionEnd" event to redirect the
browser anywhere, as that event happens on the server long after the
last request has been served.

Hans Kesting
Patrice - 30 Aug 2007 16:03 GMT
Or just test Session.IsNewSession on the next round trip.

If the timeout for authentication is lower than the session timeout you
should even have thsi done for use as the authentication module will
redirect anyway the user to the login page...

---
Patrice

>> I have an asp.net 2.0 app written in C# and VS2005. I sometimes have
>> issues where users leave a page onscreen and then come back to it a
[quoted text clipped - 20 lines]
>
> Hans Kesting
Steve - 30 Aug 2007 14:33 GMT
1. I'd set them both to 30 minutes. The IIS config will handle the
session state, and the forms auth will handle the authentication cookie.

2. This is what the auth cookie lifetime is for, which you set in the
forms auth section of the web.config. Once this lifetime expires, the
cookie is deleted (effectively logging you out).

Steve C.
MCSD,MCAD,MCSE,MCP+I,CNE,CNA,CCNA

> I have an asp.net 2.0 app written in C# and VS2005. I sometimes have
> issues where users leave a page onscreen and then come back to it a
[quoted text clipped - 14 lines]
>
> Thanks in advance for your help!
mark4asp - 31 Aug 2007 22:19 GMT
>I have an asp.net 2.0 app written in C# and VS2005. I sometimes have
>issues where users leave a page onscreen and then come back to it a
[quoted text clipped - 14 lines]
>
>Thanks in advance for your help!

This wigit worked quite nicely for me. It stops the users who have
timed-out from generating exceptions.

http://www.eggheadcafe.com/articles/20051228.asp

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.