473,651 Members | 2,538 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Why Response.Redire ct is not working in Session_End event?

Hi,
Im trying to use Response.Redire ct 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 9610
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******@discu ssions.microsof t.com> wrote in message
news:20******** *************** ***********@mic rosoft.com...
Hi,
Im trying to use Response.Redire ct 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
2798
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 interacting with my site. Anyone have any insight? Thanks in advance
5
2638
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 session_starts, we actually want to redirect the user to a different URL. Can anyone help us out here? TY in advance! Jason Shohet
1
4109
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 main Frame but not on Top. How to get a response.redirect on TOP (target Top or something) ? Thanks
1
1357
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 case of certain errors its not getting redirected (especialy Acces Violations(object refrence to null exception)). if eny body know the solution pls do reply thx in advance
11
2813
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 Abandon. I need the event to fire at Session timeout in order to capture and store the Datetime this occurs. However in the application I am writing, I have been unable discern any indication that the event is firing. I have used break...
2
2057
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
5766
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. But, when a user either navigates away from the web app and when the session timesout, the session_end event does not seem to fire. Or when else can I dispose of objects? Or is there an event I can you that is fired when a user navigates away from...
5
4561
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 a session variable, and if it is not present, does a Response.Redirect to a webpage for the CAS passing a url parameter for the url to post back to. The CAS provides a page for the user to log into, validates the username and password, and then...
4
7619
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. Recently somebody pointed out to me that you can't just press ENTER anymore after typing in the TextBox but that you HAVE to click on the submit Button WITH THE MOUSE for it to work. After some initial troubleshooting I discovered that it's only...
0
8347
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8275
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8792
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8694
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8457
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7294
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6157
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5605
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4143
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...

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.