473,903 Members | 4,818 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How can i detect a session timeout in an asp.net page?

Hi,

I would like my page_load event to detect if a session has timed out..is
this possible? Thanks.
Nov 19 '05 #1
4 3751
dee
If Session("myvar" ) Is Nothing Then
Response.Redire ct("timeout.htm ") ' for ex
End If

Hope This helps.
Dee
"John Blair" <jo********@hot mail.com> wrote in message
news:Bl******** ****@newsfe3-gui.ntli.net...
Hi,

I would like my page_load event to detect if a session has timed out..is
this possible? Thanks.

Nov 19 '05 #2
Thanks a lot - that did work - but i also found
Session.IsNewSe ssion which works too. Thanks.

"dee" <de*@home.net > wrote in message
news:e$******** ******@TK2MSFTN GP10.phx.gbl...
If Session("myvar" ) Is Nothing Then
Response.Redire ct("timeout.htm ") ' for ex
End If

Hope This helps.
Dee
"John Blair" <jo********@hot mail.com> wrote in message
news:Bl******** ****@newsfe3-gui.ntli.net...
Hi,

I would like my page_load event to detect if a session has timed out..is
this possible? Thanks.


Nov 19 '05 #3
That doesn't detect if a session has timed out.
It detects whether a session is active.

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
=============== =======

"dee" <de*@home.net > wrote in message news:e$******** ******@TK2MSFTN GP10.phx.gbl...
If Session("myvar" ) Is Nothing Then
Response.Redire ct("timeout.htm ") ' for ex
End If

Hope This helps.
Dee
"John Blair" <jo********@hot mail.com> wrote in message
news:Bl******** ****@newsfe3-gui.ntli.net...
Hi,

I would like my page_load event to detect if a session has timed out..is this possible?
Thanks.

Nov 19 '05 #4
Again, that doesn't detect whether a session has timed out.
It detects whether a session is a new session.

Those two concepts are vastly different.

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
=============== =======

"John Blair" <jo********@hot mail.com> wrote in message
news:uh******** ***@newsfe1-win.ntli.net...
Thanks a lot - that did work - but i also found
Session.IsNewSe ssion which works too. Thanks.

"dee" <de*@home.net > wrote in message news:e$******** ******@TK2MSFTN GP10.phx.gbl...
If Session("myvar" ) Is Nothing Then
Response.Redire ct("timeout.htm ") ' for ex
End If

Hope This helps.
Dee
"John Blair" <jo********@hot mail.com> wrote in message
news:Bl******** ****@newsfe3-gui.ntli.net...
Hi,

I would like my page_load event to detect if a session has timed out..is this
possible? Thanks.



Nov 19 '05 #5

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

Similar topics

4
15478
by: DavidS | last post by:
First: There are several ways to confuse one regarding session timeout. (1) web.config - <sessionState timeout="20"> (2) IIS Manager | Internet Information Services | ServerNode | Default Web Site | Properties | Configuration | Options | Enable Session State Session timeout 20 (3) within Global.asax.vb file - Session_Start subroutine can use Session.Timeout=x minutes or (4) within any web page, i.e., <web page>.aspx can use...
11
3017
by: Vishal | last post by:
Hello, can anybody tell me how I can extend the session expiry time? Is it done via code or via IIS? Sorry I am new and dont know about this.
2
9267
by: Cam | last post by:
Hi to all I have searched this subject and found some posts but none of them seem to answer my problem. I am developing a shop site and need to detect when a session times out through inactivity and tell the user that it has been reset and he has to start over. I set some session variables in a global.asa file so when the user restarts
4
4068
by: Dst | last post by:
This is what i'm trying to do: I'm porting a windows app to a web app. I have a webform which will edit some data stored in a database. The data needs to be locked in the database, while editing. On first page load: Create a custom rowlock object and store it in viewstate. When user clicks on edit, retrieve the viewstate object and lock the row in the database.
4
9465
by: UJ | last post by:
I have a page where the user can upload a video file. As you can guess, this may take a while. Is there a way I can change the session timeout for just this one page? I would also want to change the forms authentication to be a large value for that page also. TIA - Jeff.
25
6111
by: =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?= | last post by:
I tried: <sessionState timeout="1"> </sessionState> bounced IIS, and after 1 minute still had a session. ??? -- thanks - dave
2
2232
by: =?Utf-8?B?QWxoYW1icmEgRWlkb3MgS2lxdWVuZXQ=?= | last post by:
I see a lot of posts claiming that you can use AJAX or Javascript to run some kind of "heartbeat" " server polling" that tells the server that the page is still open. I need to know how exactly to do this (server side and client side) or where I can find information on doing this. I want to run some code after a page is closed and I don't want to wait for the session timeout. if anyone has information please post explanations, code...
6
3788
by: ChrisAtWokingham | last post by:
I have been struggling with unexpected error messages on an ASP.NET system, using SQL and C#. The application draws organisation charts, based on data stored in the SQL database. Some of the chart editing processes place a very heavy load on the server as the effects of the edit ripple through the organisation structure, requiring potentially large numbers of rows in one of the tables to be updated. (I have done it this way to make the more...
4
7188
by: goscottie | last post by:
I used submodal as my popup window. With some tweaks, it working great in my app. However, I can't find a way to detect session timeout in the popup window. The app is a form based authentication so the default.aspx page will show up in the popup. So I'm looking into several options. 1. detect session timeout in javascript so that I prevent the popup from even happening. I can simply redirect or post to itself so that the calling...
0
9999
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
9847
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
11283
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
10875
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
10986
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
10501
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
8049
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
7206
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
5894
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.