ajax calls clearing out my Pylons session object

4 views
Skip to first unread message

tobin

unread,
Nov 19, 2009, 8:50:07 PM11/19/09
to pylons-discuss
So I've run into some odd behavior and am wondering if anyone has
experienced this or has a solution:

I have a user-based Pylons website, requiring login/password and it
stores a userid in the Pylons session. And it's worked fine for me
until recently when:

I started populating data on the page with numerous Ajax calls
(tens?). This has caused my session obj to disappear on proceeding
pages - when I looking for my session['userid'] that was previously
set, it's gone!

If i disable my ajax calls, all goes back to normal and works.

Ideas as to why this happens?

Jonathan Vanasco

unread,
Nov 23, 2009, 12:04:18 PM11/23/09
to pylons-discuss
silly question -- is there anything in those ajax calls that clears
the session, or updates the session with a null value ?

try adding a few debug/print statements in your ajax calls to figure
out exactly where the clearing occurs

tobin

unread,
Dec 4, 2009, 8:26:35 PM12/4/09
to pylons-discuss
Thanks for the question Jonathon, I actually did do some debugging
similar to what you recommended.

The answer to my confusion is:

I manually set beaker.session.cookie_expires and session.timeout and
got some very wacky behavior (e.g. inconsistent across browsers/
platforms).

My caveat to people is to stick with the defaults unless you *really*
understand what's going on.
Reply all
Reply to author
Forward
0 new messages