Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 31st, 2004, 01:07 PM
Authorized User
 
Join Date: Jul 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default Reponse.redirect in Session_onEnd

Hello,

I am making use of session level variables through out the ASP.NET web application and I have session timeout set to 20 minutes. If I leave the browser idle for more than 20 minutes and then come back and do some task in the application and that task require using session variable, i get the error since the session was timedout.

To handle this issue I put Response.Redirect(safepage.aspx) into the Session_OnEnd event in global.aspx.vb. I tested it and found that when session timed out Session_OnEnd got fired but nothing happened. I mean Response.redirect didnt work.

Is it right to use Response object in Session event? Or is there a some other way to handle this issue.

Thanks,

 
Old August 31st, 2004, 01:57 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,101
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Since there is no connection between the browser and the server when the session is over (If there was, the session wouldn't end) you can't do a redirect in the session end event. HOWEVER, you could check if the session is active when the page it hit and redirect if there is no active logged-in session.


Hal Levy
Web Developer, PDI Inc.

NOT a Wiley/Wrox Employee





Similar Threads
Thread Thread Starter Forum Replies Last Post
Session_OnEnd Question.... seananderson Classic ASP Basics 3 July 19th, 2007 03:54 PM
session_onend does not trigger vbarbin Classic ASP Professional 1 March 16th, 2007 02:02 PM
help with session_onend chinedu Classic ASP Basics 8 October 26th, 2004 10:13 PM
Session_OnEnd v. SQL bluewater68 Classic ASP Professional 0 August 18th, 2003 04:25 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.