How do I keep a session alive

My host has set a default session timeout of 20 minutes.  I've tried using session.timeout = 60 but this does not help me as it still times out.  How can I keep a session alive for a page without using the session timeout?  Generally people using the page will want to do some good thinking as they complete the form contained on the page... they need at least 45 minutes to complete it.
philwill4uAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
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.

avinthmCommented:
There is another way to specify session time out.
You will have to specify in web.xml (ie your application config file)

Just add the following stuff in web.xml

    <session-config>
      <session-timeout>60</session-timeout>    <!-- 30 minutes -->
    </session-config>
avinthmCommented:
>  <!-- 30 minutes -->
sorry...it should be

<!-- 60 minutes -->
philwill4uAuthor Commented:
Hi,  do you mean my global.asa config file?  If yes, then this is where I currently have the session.timeout set to 60 but it still timesout in 20 minutes.
Introduction to Web Design

Develop a strong foundation and understanding of web design by learning HTML, CSS, and additional tools to help you develop your own website.

avinthmCommented:
can u tell me the technology u have used?
philwill4uAuthor Commented:
yes.... its classic ASP with VBScript
avinthmCommented:
oh sorry....i thought it was j2ee. not sure about ASP and VBScript.
deepaknetCommented:
Alternatively, you can also use from the clientside JavaScript to send a AJAX request to the server periodically.
philwill4uAuthor Commented:
Deepaknet....Do you have any sample code that I can use within ASP pages?
NightfalconCommented:
Try setting your timeout to 0
Keep in mind that with this setting, your page will never timeout!
smaccariCommented:
You can set the session timeout through your ASP script, just add at top of your ASP page:

<%Session.Timeout=60%>
philwill4uAuthor Commented:
I've tried the Session.Timeout = 60 but this doesn't work.  The host provider I have is using a web farm under Chill!soft and have set a default session time = 20 minutes.  

I think I need a javascript that can call the server to say 'I'm still here' when the timeout approaches 20 minutes.

Any ideas?
mmarksburyCommented:
Create a function in JavaScript that starts counting down from 20 minutes (in seconds) at page load.  When the timer gets to 15, have the function do something like redirect or display a message telling the user that the session is closing.

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
smaccariCommented:
You could have a hidden iframe in your page, and add a little script that refresh the page in it (an empty asp page should be enough):

<iframe name="sessionRefresh" id="sessionRefresh" style="display:none" src="myPage.asp"></iframe>
<script>
setInterval("frames['sessionRefresh'].reload()",900000); //will make the iframe refresh every 15 minutes
</script>
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
Web Languages and Standards

From novice to tech pro — start learning today.