473,404 Members | 2,179 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

Why Response.Redirect is not working in Session_End event?

Hi,
Im trying to use Response.Redirect in Session_End event in Global.asax page,
which is not working. Why this is not working? And if this not works here,
how do I hanlde this? Any possible and best solutions will be helpful.

N.B.: Here my intention is to redirect to, say Login page, when the user
session ends.

Thanks in advance,
K.V.Ravindra Kumar
Nov 18 '05 #1
1 9589
Ravindra,
Sorry, when the session ends, there is not HttpContext. There is no
active page to redirect. A user can close leave their computer and
disconnect from the Internet, and 20 minutes later this code will fire.
There is no user at this point. What you can do is check to see if the user
is logged in (if they have a session). If they don't then redirect to the
login page. Of course, this code would have to run on every page or in the
authenticate request of global.asax.

You can also put this code in your base page so that on every request you
check that the user is logged in. If not, redirect.

Best regards,
Jeffrey Palermo

"Ravindra" <Ra******@discussions.microsoft.com> wrote in message
news:20**********************************@microsof t.com...
Hi,
Im trying to use Response.Redirect in Session_End event in Global.asax page, which is not working. Why this is not working? And if this not works here,
how do I hanlde this? Any possible and best solutions will be helpful.

N.B.: Here my intention is to redirect to, say Login page, when the user
session ends.

Thanks in advance,
K.V.Ravindra Kumar

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Steve M | last post by:
Why are my sessions lasting so long? I have them set to 20 minute timeout in config file? The Session_End event is getting called an hour or more sometimes--well after the user has stopped...
5
by: Jason Shohet | last post by:
We want to redirect a user when the session ends, to a page. It doesn't seem to work (should it?). We can put the redirect in the session_start, but this causes other problems because when the...
1
by: Youss33 | last post by:
Hello, On Seesion.TimeOut I woul like to redirect the users to the login page. I am using Frames and when I put Response.Redirect in the Session_End of the Global.asax this redirect into the...
1
by: joseph pattom | last post by:
Hi all i am using <customErrors mode="On" defaultRedirect="ErrorDisplay.aspx"/> in my web.config file and getting redirected to "ErrorDisplay.aspx" in almost all the unhandled exceptions but in...
11
by: OldProgrammer | last post by:
All the documentation and discussion I have read indicate that the Session_End is not supposed to fire unless you are in "inProc" Session state mode, and then only on Session Timeout or at Session...
2
by: Nathan Sokalski | last post by:
The last two lines of code in the Click event of a Button Control on my page are: Me.WelcomeEmail() Response.Redirect("mainmenu.aspx") The last line of code in Me.WelcomeEmail() is:
8
by: Roger | last post by:
When I call the session.abandon() method, it calls the session_end event. When a user closes the browser or clicks the log off button, I can dispose of objects and abandon the session cleaning....
5
by: venner | last post by:
I'm having an issue with an ASP.NET website after upgrading to ASP.NET 2.0. The website makes use of a central authentication service (CAS) provided at the university I work for. Each page checks...
4
by: nkoier | last post by:
Hi, I've been going crazy trying to figure out what's wrong with our Asp.Net 2.0 intranet site. At the very top of our main page I provide a TextBox and a Button for submitting Google searches....
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.