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.
> <!-- 30 minutes -->
sorry...it should be
<!-- 60 minutes -->
sorry...it should be
<!-- 60 minutes -->
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?
ASKER
yes.... its classic ASP with VBScript
oh sorry....i thought it was j2ee. not sure about ASP and VBScript.
may be these links may help you
http://www.aspfaq.com/show.asp?id=2066
http://docs.sun.com/source/817-2514-10/Ch9_ASPBuiltIn183.html
http://www.aspfaq.com/show.asp?id=2066
http://docs.sun.com/source/817-2514-10/Ch9_ASPBuiltIn183.html
Alternatively, you can also use from the clientside JavaScript to send a AJAX request to the server periodically.
ASKER
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!
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%>
<%Session.Timeout=60%>
ASKER
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?
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
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.
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</sessi
</session-config>