Interview with Ploners
Formulator makes life easy
Server side python
Getting undo history
Plone roles on
« Unison - file and directory synchroniser
» Mozilla Firebird 0.6
Zope’s transient object session timeout defaults to 20 minutes. To set the timeout, go to /temp_folder/session_data and change the timeout there. When the timeout is changed, all objects in the session are cleared - so better not do this while people are on-line.
Unfortunately, this value gets reset to 20 minutes, every time Zope is restarted. My Zope servers are restarted every morning at 6:30am. I hacked in a reset script that is called at 7:10am every day. This script sets the timeout to 3 hours. It can be called using XML-RPC or through simple wget.
## Script (Python) "reset_session_timeout"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=set_timeout_to=180
##title=Set the timeout in default session manager to specified value
##
"""
Please go to this script like http://whatever_server/reset_session_timeout
after every restart of the server
"""
sess = container.temp_folder.session_data
curr = sess.getTimeoutMinutes()
set_timeout_to=int(set_timeout_to)
if curr != set_timeout_to:
sess.setTimeoutMinutes(set_timeout_to)
return sess.getTimeoutMinutes()
Give this proxies of Owner and Manager - both these are not necessary, but this is the easy way out
I believe there's an environment variable you can set in the 'start' script to set the timeout.
Check out 'doc/ENVIRON.txt'.
Nicely - in Zope 2.7, all those environment variables are going away and Zope will be configurable via an Apache-like config file.
Jeff is right, there is an env variable for this. For the sake of understanding - and should you ever need to have greater control over what shows up in the temp_folder on startup, you can see/change the code in /lib/python/OFS/Application.py
for an overview of sessions
see:
http://usergram.com/iis/session/
We can set session variables Nicely in Zope2.7.
you can find zope.conf file in your Zope2.7 instance home,located in path INSTANCE_HOME/etc/zope.conf.
In zope.conf they documented very good, every one can understand and set.
Hello Babu - Funny that I found this page on google, I guess I should have looked here in the first place! :-)
Since my company has no plans to move to 2.7 anytime soon we are stuck with version 2.5. I have looked at the application.py script and was wondering if I could get a little more info on what to change.
Would I just have to change this line?
timeout_spec = env_has('ZSESSION_TIMEOUT_MINS', '')
Any direction would be greatly appreciated..
Let me answer my own question, all I had to do was goto /lib/python/OFS/Application.py and change:
timeout_spec = env_has('ZSESSION_TIMEOUT_MINS', '')
To:
timeout_spec = env_has('ZSESSION_TIMEOUT_MINS', '45')
Cheers!