Hi there,
I tried to follow the examples on the website as much as I could. I
ended up confused about the usage of sessions and hope you can help me
out :)
I deployed web.py with Apache+mod_wsgi as recommended to make use of
sessions without the reload problem.
In my script, I have a line now:
session = web.session.Session(app,
web.session.DiskStore(tempfile.mkdtemp()), {'loggedin': False,
'username': '', 'count' : 0})
which is the first problem. I saw that there are files in the
directory I specify there, in my case a temporary one. So I would
expect that the session module looks into that directory and looks if
there is a file matching the session ID passed with the cookie. The
problem here is: If I restart Apache in the meantime, or just modify
my script: Then all sessions are lost, aren't they? But if I put a
static name there, like '/tmp/sessions', I get a new session ID
everytime I reload.
Then I have a simple "count" class which increments a number in the
session variable, like
session['count'] += 1
and displays it.
When I reload in my browser, the number starts to increase like
intended, but at some point the session id and HTTP_COOKIE values
change and I start counting at 1 again. The number up to where I can
count is not predictable.
So, I hope you can point me into the right direction. Is session
handling not as magic as I thought it will be? I there a fundamental
misunderstanding from my side?
Cheers,
Philipp
--
You received this message because you are subscribed to the Google Groups
"web.py" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/webpy?hl=en.