473,796 Members | 2,740 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

session timeout

Is there a way to see if the session is going to timeout and then warn the
user or display a page that it timed out
Dec 10 '05 #1
2 2655
polilop wrote on 10 dec 2005 in microsoft.publi c.inetserver.as p.general:
Is there a way to see if the session is going to timeout and then warn
the user or display a page that it timed out


Set a clientside code timer that is reset on each new page and
that fires after less than 20 minutes.

Not ideal, eh?

Better warn them if they try something while no more in session,
that is while needing to login again an arriving there
not from the normal starting page.

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Dec 10 '05 #2
This code seems to work good for me:

<div class="skeleton " id="timer" style="color:gr ay;font-family: Verdana;
font-size: 8pt">

</div>
<script language=javasc ript>
var dd=<%= Session.Timeout *60-2 %>;
var csptimeout=0;
function CSPstartClock(r eset,timeout,wh atdoc,towhere) {
if (reset) {
md=dd
}
if (md>0) {
time=md*1000
if (csptimeout!=0) {
clearTimeout(cs ptimeout);
}
csptimeout=setT imeout("CSPstar tClock(0)",1000 )
dhour=Math.floo r((time%(60*60* 1000*24))/(60*60*1000)*1)
dmin=Math.floor (((time%(60*60* 1000*24))%(60*6 0*1000))/(60*1000)*1)
dsec=Math.floor ((((time%(60*60 *1000*24))%(60* 60*1000))%(60*1 000))/1000*1)
dsecDisplay = dsec.toString() ;
dminDisplay = dmin.toString() ;
if (dminDisplay.le ngth == 1) {
dminDisplay = "0" + dminDisplay ;
}

if (dsecDisplay.le ngth == 1) {
dsecDisplay = "0" + dsecDisplay ;
}
self.document.g etElementById(' timer').innerHT ML=dhour+':'+dm inDisplay+':'+d secDisplay+' remaining until session timeout';
}
else {
if(timeout==nul l) { timeout='1790'}
if(whatdoc== null) { whatdoc=''; if(whatdoc=='')
{whatdoc='docum ent.location.hr ef';}}
if(towhere==nul l) { towhere='/osc2.0/osc_scripts/abandonSession. asp';}
mycounter = setTimeout(what doc+'="'+towher e+'"',1000)
}
md=md-1
}

CSPstartClock(1 );

</script>

"polilop" wrote:
Is there a way to see if the session is going to timeout and then warn the
user or display a page that it timed out

Dec 11 '05 #3

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

Similar topics

12
43199
by: Geigho | last post by:
Setting session timeout in web.config file does not seem to have any effect. Any explanation or suggestion will be appreciated.
4
15471
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...
8
7316
by: Joe Abou Jaoude | last post by:
hi, I have a web app with forms authentication and a timeout session of 20 mins for security reasons. I recently added a feature that allows users (if they want to) to automatically log in (without entering username and password) using the cookies. Now in this case the 20 mins session timeout has no meaning anymore so I m thinking to make the timeout infinite in this case only. my question is, if i do this, and then a user used the...
11
3013
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.
5
2091
by: Just D. | last post by:
Do we have any access to the Session object from a different Session? The idea is to save Session of a current user and then if he logs in again then return the Session back. It's not a problem to store, there is only one complicated object in this Session, but to get it on SessionStart to make a copy this is a problem. Maybe using Application or whatever? Or this data is divided and inaccessible anyway? Just D.
8
5499
by: bdeviled | last post by:
I am deploying to a web environment that uses load balancing and to insure that sessions persist across servers, the environment uses SQL to manage sessions. The machine.config file determines how all applications will use sessions and to insure that all application use this method, the session properties cannot be overriden. Within the sessionstate tags, the webadmin (upon my request)r emoved the property for timeout, hoping that...
17
5218
by: jensen bredal | last post by:
Hello, i'm struggling with a somehow badly understood session scenario. I provide acces to my pages based on form authentication using Session cookies. Som of my pages are supposed to be running continuously and refreshing once an hour. I there set timeout= 61 in <sessionState section and on my page it says <meta http-equiv="refresh" content="3600">. I also set timeout=120 in the <forms section of web.config to make sure
4
9460
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
6102
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
6
3785
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...
0
9685
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
10467
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...
1
10201
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
10021
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
7558
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
6802
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
5454
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...
1
4130
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
3
2931
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.