﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
22427	_session_cache of SessionBase affected by database session engine save	anonymous	nobody	"I am running the exact same code on my local development machine and a production server.

Everything important I can think of is the same: both Ubuntu 13.10, both Python 2.7.5+, both Django 1.6.2, etc.

Yet the two machines are producing different behaviour!

I modified the file django/contrib/sessions/middleware.py, like so:

{{{
import sys
sys.stderr.write('\nBefore!\n')
for key, value in request.session.iteritems():
   sys.stderr.write('%s=%s\n'%(key, value))
request.session.save()
sys.stderr.write('\nAfter!\n')
for key, value in request.session.iteritems():
   sys.stderr.write('%s=%s\n'%(key, value))
}}}

So I am ""printing"" the session data before and after it is saved in the middleware.

On my machine, the data in question is present before and after (e.g. key = 'hello', value = '123'), but on the production server, the data in question is neither present before or after the save.

I have no idea how this is possible, but it's happening and driving me crazy.

Note: I am setting the session entry like so (in my view):
{{{
request.session['hello'] = '123'
}}}
So somewhere between that dict insertion and the middleware processing, the entry is completely disappearing, yet both machines are running identical code!"	Bug	closed	contrib.sessions	1.6	Normal	needsinfo	session dict disappear middleware save database	carsrule@…	Unreviewed	0	0	0	0	0	0
