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 ?
LVL 1
AleksAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
The problem they are having is the idle time out which is attached to the application pool.   In iis you can adjust the idle time out.  http://technet.microsoft.com/en-us/library/cc771956(v=ws.10).aspx

What probably happens is they are staring at the screen or typing into a wysiwyg for longer then 10 minutes.
0
AleksAuthor Commented:
Checking on the app pool settings
0
AleksAuthor Commented:
That was not the issue. it was set to 120 minutes.  How can I display the time out left on the screen tho ?
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
All you can do is put up a client side timer based on some event like the window opening. http://keith-wood.name/countdown.html

If you have everything set to ample times, could it be the app pool is overloaded and resets.
0
dimmergeekCommented:
The link title was the question that I was referncing and the link went to an answer in that question.
0
AleksAuthor Commented:
I see that code is for ASP.net. I am using ASP Classic as you can read in my first paragraph.
0
AleksAuthor Commented:
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("CheckSessionStatus();", 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("CheckSessionStatus();", 1000);
    }
}

But when I display the session using:

Session:<%=Session("Timeout")%>

Nothing is displayed. Is this the correct name of the session to display ?
0
dimmergeekCommented:
The script assumes that you know the session timeout value which is configured on your server.
0
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
Where are you using Session:<%=Session("Timeout")%>?

Since Session("Timeout") is static, you may as well just enter the number.  

At least in classic asp, there is nothing that I know of to actually track when a session is about to break that is directly related to whatever is actually tracking the session.  Also the session can reset when the app pool over loads.

A simple timer that is set a minute less then the time out is supposed to run out is all you need.  It can contain 2 buttons, log out or continue.  The continue button can send an ajax request to another page and  your session is refreshed and your timer should be restarted.

I would figure out first what is timing out.  It sounds like the time out is happening before you have your session and idle time outs set.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
AleksAuthor Commented:
thx
0
dimmergeekCommented:
Thank you.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP

From novice to tech pro — start learning today.