473,406 Members | 2,208 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,406 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 7670
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;...
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: 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
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
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
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...
0
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,...

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.