473,789 Members | 2,530 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Automatic Redirect Of Page after Session Expire

windows_mss
13 New Member
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 7688
Frinavale
9,735 Recognized Expert Moderator Expert
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
tomonthebay
5 New Member
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
15577
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 the form using VBscript? Terry <% ' ... some asp processing
4
7821
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 ends the session, without a proper logout. The user can't see that he is logged out, hits a button and gets mutiple errors because MySQL is no longer available. Is there a way to to warn the user a minute before the session is ended? I just...
10
12211
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 an object that stores the user's basic profile data (username, user type, associated sales region, etc.). I've been taking this user info and placing it in the Session object like so... Session = user;
3
3698
by: ABC | last post by:
How to automatic redirect if session timeout using ASP.NET 1.1?
3
4735
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, in it's place, have a noevents page displayed. My server has Perl, Php and FrontPage extensions installed but I haven't been able to find a script anywhere that will do the job. Thanks in advance
12
1491
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 response.Redirect("pregled.asp?ime=" & strUserName & " & prezime = " & strUserLastName) but it didn't work.
0
920
by: kramprasad | last post by:
hi friends, In asp how to redirect to a login page when session is loss or expire.
8
3838
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 Response.Redirect("../login/login.aspx") End If The above code works correctly. but my question is the user enter the correct username and password in the login.aspx page . it will automatically redirect to previous page (useraccount.aspx; useraccount.aspx is the...
5
6798
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; and someone cannot navigate back to an cached image of the page in theory after the user has signed off. Response.Cache.SetCacheability(HttpCacheability.NoCache); This works all right, except when the user decides to use the browser's back...
0
9506
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
10404
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
10193
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
10136
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
9016
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
7525
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
5548
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4089
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3695
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.