Re: [Myghty-users] session problem
Brought to you by:
zzzeek
From: mike b. <mi...@my...> - 2005-01-06 19:06:04
|
David - does your shopping cart demo work ? its using the session as well with the standalone server, via a module component. if you can add items to your cart and they stay there, then that particular session implementation is working. try to see how your code differs from the demo code (which is not to say your code is wrong, it is to say that it would reveal what is different and may be what the session's interface is tripping on). some other things to check: - if you specify "session_key", that will not take effect if the session has already been called in for that request with a different key. make sure you dont have use_session declared in the config, and no other code is calling it in. still, that wouldnt quite create the situation you are having. though if this is part of the problem, a workaround that should be guaranteed to use a fresh new session object with the desired parameters is to do: import myghty.session as session s = session.Session(r, key = 'mykey', secret = ...) make sure you dont use the "session_" prefix for the params in that case. - also try not using the "secret" parameter. I tested the "secret" quite a bit but it is an additional layer of complexity, maybe the problem is related to it. is the "secret" an unchanging value ? - is the s.is_new attribute being set to True each time you get the new session id ? - whats the value of s.was_invalidated when you get the new session id ? - if all that fails: try adding a "tripwire" to the _create_id method of Session inside of session.py: flag = False def _create_id(self): if Session.flag: raise "tripwire!" else: Session.flag = True # ... rest of method make that change, then run the server clean. the _create_id method of session will then be called once, and then all subsequent times return a stack trace in the standard error of the server. then at least I can take a look at that trace and see what is creating the condition. sorry youre having trouble ! whether or not there is a bug in the session object, I hope to improve the docs/interface to prevent whatever this issue is once we figure it out. - mike |