Aleks
asked on
Display session time out on ASP page
I am having issues with a client who is being kicked out of a web application after they log in only after 10 min.
I have already checked all server settings and they are set to be 999 minutes, yet they get kicked out after 10 min.
I want to display on the screen the time left before the session expires, so that I can prove that the system is NOT kicking them out and its something else.
How can I display the time left on a session using ASP classic ?
I have already checked all server settings and they are set to be 999 minutes, yet they get kicked out after 10 min.
I want to display on the screen the time left before the session expires, so that I can prove that the system is NOT kicking them out and its something else.
How can I display the time left on a session using ASP classic ?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That was not the issue. it was set to 120 minutes. How can I display the time out left on the screen tho ?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I see that code is for ASP.net. I am using ASP Classic as you can read in my first paragraph.
ASKER
I am using this script on the page:
function InitSessionTimer() {
warn_sec = 59 * 60 * 1000; //Warning time in milliseconds
timeout_sec = 60 * 60 * 1000; //Actual timeout in milliseconds
show_warning = true;
epoch = new Date().getTime();
CheckSessionStatus();
}
InitSessionTimer();
function CheckSessionStatus() {
//Check for session warning
epoch2 = new Date().getTime();
if (epoch2 > epoch + warn_sec && epoch2 < epoch + timeout_sec && show_warning) {
show_warning = false; //Don't show again
alert_shown = true;
alert("Your session will timeout in " + Math.round((timeout_sec - warn_sec) / 60000) + " minute, please click a button or navigate to another page to refresh your session before it expires.");
down = setTimeout("CheckSessionSt atus();", 1000);
} else if (epoch2 > epoch + timeout_sec) {
alert("Your session has timed out.");
window.location.href = 'http://yoursite.com/some/page/to/redirect/to';
} else {
down = setTimeout("CheckSessionSt atus();", 1000);
}
}
But when I display the session using:
Session:<%=Session("Timeou t")%>
Nothing is displayed. Is this the correct name of the session to display ?
function InitSessionTimer() {
warn_sec = 59 * 60 * 1000; //Warning time in milliseconds
timeout_sec = 60 * 60 * 1000; //Actual timeout in milliseconds
show_warning = true;
epoch = new Date().getTime();
CheckSessionStatus();
}
InitSessionTimer();
function CheckSessionStatus() {
//Check for session warning
epoch2 = new Date().getTime();
if (epoch2 > epoch + warn_sec && epoch2 < epoch + timeout_sec && show_warning) {
show_warning = false; //Don't show again
alert_shown = true;
alert("Your session will timeout in " + Math.round((timeout_sec - warn_sec) / 60000) + " minute, please click a button or navigate to another page to refresh your session before it expires.");
down = setTimeout("CheckSessionSt
} else if (epoch2 > epoch + timeout_sec) {
alert("Your session has timed out.");
window.location.href = 'http://yoursite.com/some/page/to/redirect/to';
} else {
down = setTimeout("CheckSessionSt
}
}
But when I display the session using:
Session:<%=Session("Timeou
Nothing is displayed. Is this the correct name of the session to display ?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thx
Thank you.
ASKER