I am trying to store a python object in the session data, which holds lots of parameter values from various previously visited forms. All of the submit actions push to the same view function.
After seeing that data appear to be randomly wrong, I am managing the saving of this data myself with cPickle. Now i just place the filename in the session to know what to load etc... It looks like I get old session data sent to my function instead of the current session data. I only see this in a deployed system (apache) I have tried it with both the worker and prefork mpm, both mod_python and mod_wsgi. here is a log that explains what i am seeing. --- params --- means a new call to my view function Every place I interact with the session I dump a message to the log file along with a timestamp stuffed into the session the last time a new file was created. Here is the log: --- params --- *** created new pstate file: /tmp/tmpfHJMAU.cs_submit *** wrote pstate to file: /tmp/tmpfHJMAU.cs_submit 2010-12-02 10:13:13.099350 --- params --- 2010-12-02 10:13:13.099350 loading pstate from file: /tmp/tmpfHJMAU.cs_submit 2010-12-02 10:13:13.099350 wrote pstate to file: /tmp/tmpfHJMAU.cs_submit 2010-12-02 10:13:13.099350 --- params --- 2010-12-02 10:13:13.099350 loading pstate from file: /tmp/tmpfHJMAU.cs_submit 2010-12-02 10:13:13.099350 wrote pstate to file: /tmp/tmpfHJMAU.cs_submit 2010-12-02 10:13:13.099350 --- params --- 2010-12-02 10:13:13.099350 loading pstate from file: /tmp/tmpfHJMAU.cs_submit 2010-12-02 10:13:13.099350 wrote pstate to file: /tmp/tmpfHJMAU.cs_submit 2010-12-02 10:13:13.099350 --- params --- 2010-12-02 10:13:13.099350 loading pstate from file: /tmp/tmpfHJMAU.cs_submit 2010-12-02 10:13:13.099350 wrote pstate to file: /tmp/tmpfHJMAU.cs_submit 2010-12-02 10:13:13.099350 --- params --- 2010-12-02 10:13:13.099350 loading pstate from file: /tmp/tmpfHJMAU.cs_submit 2010-12-02 10:13:13.099350 wrote pstate to file: /tmp/tmpfHJMAU.cs_submit 2010-12-02 10:13:13.099350 --- params --- 2010-12-02 10:13:13.099350 loading pstate from file: /tmp/tmpfHJMAU.cs_submit 2010-12-02 10:13:13.099350 cleared from cookie, deleted pstate file: /tmp/tmpfHJMAU.cs_submit 2010-12-02 10:13:13.099350 --- params --- 2010-12-02 10:13:13.099350 *** created new pstate file: /tmp/tmpbjnTGv.cs_submit *** wrote pstate to file: /tmp/tmpbjnTGv.cs_submit 2010-12-02 10:15:12.859097 --- params --- 2010-12-02 10:13:13.099350 loading pstate from file: /tmp/tmpfHJMAU.cs_submit 2010-12-02 10:13:13.099350 In particular the last 3 calls are the issue. I delete the file, and filename from the session, next call I create a new file and stuff that filename into the session, and finally the last call for some reason has the wrong session data. It for some reason has the old data and timestamp, SESSION_COOKIE_AGE 1209600 SESSION_COOKIE_DOMAIN None SESSION_COOKIE_NAME 'sessionid' SESSION_COOKIE_PATH '/' SESSION_COOKIE_SECURE False SESSION_ENGINE 'django.contrib.sessions.backends.cached_db' SESSION_EXPIRE_AT_BROWSER_CLOSE False SESSION_FILE_PATH None SESSION_SAVE_EVERY_REQUEST True With save every request set, I am assuming this is pushed through the cache into the database, i am not sure how i can have this bogus session data given to me? Am I misunderstanding how this should work? -- You received this message because you are subscribed to the Google Groups "Django developers" 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/django-developers?hl=en.
