472,958 Members | 2,193 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Automatic Redirect Of Page after Session Expire

windows_mss
hi Programmers,

In course of my project now i facing an proble that i have to Redirect the page to some other Page after the Default Session Time Expire
Expand|Select|Wrap|Line Numbers
  1. <sessionState 
  2.             mode="InProc"
  3.             stateConnectionString="tcpip=127.0.0.1:42424"
  4.             sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
  5.             cookieless="false" 
  6.             timeout="10" 
  7.     />
  8.  
  9.  
Here my Default time is 10, If User is Idel for more than 10 min in that case page should be automatically redirected into some other page.

Help Needed,

Thanks In Advance
Mar 6 '07 #1
2 7651
Frinavale
9,735 Expert Mod 8TB
hi Programmers,

In course of my project now i facing an proble that i have to Redirect the page to some other Page after the Default Session Time Expire
...

Here my Default time is 10, If User is Idel for more than 10 min in that case page should be automatically redirected into some other page.

Help Needed,

Thanks In Advance
Hello!

I remember solving this problem not too long ago. My solution might not be the best one out there but it's simple enough. Whenever one of my pages did a postback I'd check if the session was new...if it was then their session had expired or they had tried to jump to a page without going through the proper channels.

In every piece of code that handles a post back I inserted the following:
Expand|Select|Wrap|Line Numbers
  1. If Session.IsNewSession = False Then
  2.      'Do processing here because the session hasn't expired
  3. Else 
  4.      'This is the case when the session has expired...
  5.       'so we don't process anything and just transfer/redirect 
  6.       'back to the beginning
  7.       Server.Transfer("StartPage.aspx", False)
  8. End If
  9.  
Cheers
-Frinny
Mar 6 '07 #2
What Frinny does is good, as I also on every page load I check the value of the session and if the session is nothing then I redirect to a default page expired.

The only way you can make it go there automatically after 10 minutes is to run a timer. ( I think- from years ago when I tried)

Have fun! T
Mar 8 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

12
by: Terry | last post by:
I'm trying to automatically submit a form to another ASP page after some <input> fields values are filled by ASP. I know I can do it using javascript, but is there a way to automatically submit...
4
by: Chris Stegeman | last post by:
Hello there, On my site people have to log in and automatically start a session. An authorized login grants access to other pages and MySQL data. However when the user waits to long, the server...
10
by: GreggTB | last post by:
I've got an page (LOGIN.ASPX) that receives the user's login information. During the page load, it checks the credentials against a database and, if validation is successful, creates an instance of...
3
by: ABC | last post by:
How to automatic redirect if session timeout using ASP.NET 1.1?
3
by: bbgraph | last post by:
Does anyone have a suggestion for doing this with a date function rather than the typical content=(number of seconds) function? I have an events page that I'd like to expire on a certain date and,...
12
by: gigi | last post by:
How to send more than one value using response redirect? For example i can send one like this response.Redirect "pregled.asp?ime=" & strUserName but how to send two or more values? I tried...
0
by: kramprasad | last post by:
hi friends, In asp how to redirect to a login page when session is loss or expire.
8
pentahari
by: pentahari | last post by:
Redirect to login page if session("UserName") is expired when the page useraccount.aspx load event My useraccount.aspx code : If Session("UserName") Is Nothing Then ...
5
by: =?Utf-8?B?Y2hlY2tyYWlzZXJAY29tbXVuaXR5Lm5vc3BhbQ== | last post by:
I have a site which I secure with forms authentication. When the user's sign on and hit one of the secure pages, I have this line in my code to ensure that the browser does not cache the page;...
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

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.