473,387 Members | 1,481 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,387 software developers and data experts.

how to redirect to loginpage after session timeout

in my web.config i have the following :

<sessionState

mode="InProc"

stateConnectionString="tcpip=127.0.0.1:42424"

sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"

cookieless="false"

timeout="120"

/>

After 120 minutes of inactivity, the session times out and i lose my
session data. This is what I want, but I want that the user get redirected
to the logon page if it happens that he is hitting the server again once his
session is already timed out. Is there any mechanism allowing this in
theASP.NET framework? Or is it something I have to do "manually"?

Thanks in adcance and best regards,

Francois


Nov 18 '05 #1
2 5456
Hi Francois
If you are using forms authentication then you can use
<forms loginUrl="login.aspx" ...../> which redirects to the login page when the session is timed out.
Otherwise you can redirect the user to the login page in the Session_End event in the global.asax
Hope that helps :
srini
Nov 18 '05 #2
Hello
I am using Forms Authentication. but the page is not redirect to desired
login page after session is expired.
When I debug the application. Session_end is called. in the Session_End
method i write code to redirect to the LoginPage but it is still not
redirecting. it runs the redirecting code but physically not redirect.

What should I do more.?

Regards
Ather Ali
----- Original Message -----
From: "francois" <fr******@bettinghouses.com_NOSPAM>
Newsgroups: microsoft.public.dotnet.framework.aspnet
Sent: Tuesday, May 25, 2004 09:05
Subject: how to redirect to loginpage after session timeout

in my web.config i have the following :

<sessionState

mode="InProc"

stateConnectionString="tcpip=127.0.0.1:42424"

sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"

cookieless="false"

timeout="120"

/>

After 120 minutes of inactivity, the session times out and i lose my
session data. This is what I want, but I want that the user get redirected
to the logon page if it happens that he is hitting the server again once his session is already timed out. Is there any mechanism allowing this in
theASP.NET framework? Or is it something I have to do "manually"?

Thanks in adcance and best regards,

Francois

Nov 18 '05 #3

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

Similar topics

1
by: Grant | last post by:
Hi, I have searched the net and still no luck... I just want to automatically have a page redirected to another page when the timeout set in the config file expires. I currently have: ...
0
by: Ed Henn | last post by:
I'm having a problem with .NET Forms Authentication in a particular application. It's not redirecting properly when my session is timed out, seemingly only when I POST the page (i.e. click a form...
6
by: Weave | last post by:
I would like to redirect to a logout page after a session has timed out. I have placed a response.redirect "loggedoff.asp" in the Session_OnEnd subroutine in the global.asa, but it does not move...
1
by: Ather Ali Shaikh | last post by:
Hello I am using Forms Authentication. but the page is not redirect to desired login page after session is expired. When I debug the application. Session_end is called. In the Session_End method...
10
by: Anthony Williams | last post by:
Hi gang, This one looks like a bug :o( As you may or may not know, setting session management in web.config to use cookieless sessions causes the ASP.NET runtime to munge a session ID into...
1
by: Anders Jacobsen | last post by:
Hey Im devloping an application in asp.net 1.1 SP2. I need to control timeout values for each user. Im having trouble to make it work. When the session timouts out I want to redirect the user to...
1
by: Clare Strickson | last post by:
Hi Is it possible to redirect the user to a login page when the session has timed out? thanks in advance David Strickson
3
by: ABC | last post by:
How to automatic redirect if session timeout using ASP.NET 1.1?
0
by: Hrvoje Vrbanc | last post by:
Hello all, I have recently encountered a very strange problem: on every redirect from a codebehind page, sessions break. A varible is correctly stored in a session on a page and then, when a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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,...

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.