Click here to Skip to main content
15,887,843 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Session Expired Problem Pin
sjs4u27-Mar-08 22:57
sjs4u27-Mar-08 22:57 
GeneralRe: Session Expired Problem Pin
eyeseetee27-Mar-08 23:14
eyeseetee27-Mar-08 23:14 
GeneralRe: Session Expired Problem Pin
sjs4u27-Mar-08 23:16
sjs4u27-Mar-08 23:16 
GeneralRe: Session Expired Problem Pin
eyeseetee27-Mar-08 23:49
eyeseetee27-Mar-08 23:49 
GeneralRe: Session Expired Problem Pin
Bogdan Damian1-Apr-08 7:20
Bogdan Damian1-Apr-08 7:20 
GeneralSignout my webpage Pin
SathyaSiva27-Mar-08 20:49
SathyaSiva27-Mar-08 20:49 
GeneralRe: Signout my webpage Pin
eyeseetee27-Mar-08 22:16
eyeseetee27-Mar-08 22:16 
AnswerRe: Signout my webpage Pin
Jesse Squire28-Mar-08 2:38
Jesse Squire28-Mar-08 2:38 
There are a few ways that you could go about doing this, each with their own set of trade-offs. The first couple that come to mind for me are:

Use the built-in ASP.NET session management and force your logout code to run when the session expires (see the Session_End handler in global.asax. The default session expiration is a 20 minute sliding timer from the last request/response activity. This number can be tuned to your liking, but remember that it will effect a user that leaves their browser idle as well as one that actively browsed away from your site.

Another possibility is to use a session-based cookie (reference[^]) to signify that a user has logged into your site and use the unload event of the window object (reference[^]) in client script to force your logout code to run. The downside here is that you would be logging the user out each time they navigated from page-to-page, even within your site and you would have to read the cookie to verify that they're authenticated to your site and run your login code each time. The result is rather messy, as your login and logout code are running for each page of your site. The user would also be able to leave your site and return still authenticated until they closed their browser.

My recommendation would be to consider the first technique of using the built-in session. Unless you have extremely sensitive content or logout code that absolutely must run immediately, I find that the session is usually a good trade-off.

Hope that helps a bit to get you started. Smile | :)

  --Jesse
"... the internet's just a big porn library with some useful articles stuck in." - Rob Rodi

GeneralDifference Between ASP.NET 2003, 2005, 2008 Pin
varshavmane27-Mar-08 19:50
varshavmane27-Mar-08 19:50 
GeneralRe: Difference Between ASP.NET 2003, 2005, 2008 Pin
Christian Graus28-Mar-08 1:49
protectorChristian Graus28-Mar-08 1:49 
Questionreferral url Pin
RajeevKumarSharma27-Mar-08 19:43
RajeevKumarSharma27-Mar-08 19:43 
GeneralRe: referral url Pin
Jesse Squire28-Mar-08 2:04
Jesse Squire28-Mar-08 2:04 
AnswerRe: referral url Pin
Guffa28-Mar-08 2:05
Guffa28-Mar-08 2:05 
Generalblock anonymous users from viewing a page for a few times Pin
mukesh.mr0327-Mar-08 19:12
mukesh.mr0327-Mar-08 19:12 
GeneralRe: block anonymous users from viewing a page for a few times Pin
Christian Graus27-Mar-08 19:35
protectorChristian Graus27-Mar-08 19:35 
AnswerRe: block anonymous users from viewing a page for a few times Pin
Bogdan Damian1-Apr-08 7:09
Bogdan Damian1-Apr-08 7:09 
QuestionactiveX Control.. Pin
ptr2void27-Mar-08 19:12
ptr2void27-Mar-08 19:12 
GeneralRe: activeX Control.. Pin
Christian Graus27-Mar-08 19:32
protectorChristian Graus27-Mar-08 19:32 
QuestionRe: activeX Control.. Pin
ptr2void27-Mar-08 19:42
ptr2void27-Mar-08 19:42 
QuestionRe: activeX Control.. Pin
ptr2void27-Mar-08 20:35
ptr2void27-Mar-08 20:35 
QuestionThreadPool thread limit = potential deadlock? Pin
Mike Marynowski27-Mar-08 12:05
professionalMike Marynowski27-Mar-08 12:05 
AnswerRe: ThreadPool thread limit = potential deadlock? Pin
N a v a n e e t h27-Mar-08 16:37
N a v a n e e t h27-Mar-08 16:37 
AnswerRe: ThreadPool thread limit = potential deadlock? Pin
Guffa28-Mar-08 1:59
Guffa28-Mar-08 1:59 
GeneralRe: ThreadPool thread limit = potential deadlock? Pin
N a v a n e e t h28-Mar-08 3:03
N a v a n e e t h28-Mar-08 3:03 
GeneralAJAX UpdatePanel for Menu Control Pin
Ekjon27-Mar-08 10:54
Ekjon27-Mar-08 10:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.