473,322 Members | 1,408 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,322 software developers and data experts.

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 2633
polilop wrote on 10 dec 2005 in microsoft.public.inetserver.asp.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:gray;font-family: Verdana;
font-size: 8pt">

</div>
<script language=javascript>
var dd=<%= Session.Timeout*60-2 %>;
var csptimeout=0;
function CSPstartClock(reset,timeout,whatdoc,towhere) {
if (reset) {
md=dd
}
if (md>0) {
time=md*1000
if (csptimeout!=0) {
clearTimeout(csptimeout);
}
csptimeout=setTimeout("CSPstartClock(0)",1000)
dhour=Math.floor((time%(60*60*1000*24))/(60*60*1000)*1)
dmin=Math.floor(((time%(60*60*1000*24))%(60*60*100 0))/(60*1000)*1)
dsec=Math.floor((((time%(60*60*1000*24))%(60*60*10 00))%(60*1000))/1000*1)
dsecDisplay = dsec.toString() ;
dminDisplay = dmin.toString() ;
if (dminDisplay.length == 1) {
dminDisplay = "0" + dminDisplay ;
}

if (dsecDisplay.length == 1) {
dsecDisplay = "0" + dsecDisplay ;
}
self.document.getElementById('timer').innerHTML=dh our+':'+dminDisplay+':'+dsecDisplay+' remaining until session timeout';
}
else {
if(timeout==null) { timeout='1790'}
if(whatdoc== null) { whatdoc=''; if(whatdoc=='')
{whatdoc='document.location.href';}}
if(towhere==null) { towhere='/osc2.0/osc_scripts/abandonSession.asp';}
mycounter = setTimeout(whatdoc+'="'+towhere+'"',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
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
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...
8
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...
11
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
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...
8
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...
17
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...
4
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...
25
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
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.