Link to home
Start Free TrialLog in
Avatar of philwill4u
philwill4u

asked on

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.
Avatar of avinthm
avinthm

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>
>  <!-- 30 minutes -->
sorry...it should be

<!-- 60 minutes -->
Avatar of philwill4u

ASKER

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

<%Session.Timeout=60%>
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?
ASKER CERTIFIED SOLUTION
Avatar of mmarksbury
mmarksbury

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial