On Oct 19, 3:13 pm, Quiet Light Development <blued...@quietlightcom.com> wrote: > Hello, > > I am having trouble getting sessions to work with my production > server. When I move from one page to the next and try to call > request.session["app"] it is giving me a key error even though I know > I had set it in the previous page. This error is only occurring in IE. > Firefox and Chrome work properly. A little about the server: > > Django version 1.2.1 > Session engine 'django.contrib.sessions.backend.db' > > I'm not using cookies at all presently, but trying to track sessions > through the database. > > Does anyone have experience with this issue? > > Thanks, > Ben
Unfortunately the advice you've been getting in this thread has not been very reliable. This has nothing to do with threaded Apache environments, or anything like that. Although you're not using cookies explicitly, Django does automatically use a cookie to identify a user, so that their session data is preserved across requests. This is non-configurable - see the explanation here: http://docs.djangoproject.com/en/1.2/topics/http/sessions/#session-ids-in-urls The cookie is just used to identify a session - all the data is actually stored in the sessions backend: the db table, in your case. There are two places you should check to see what's going wrong. Firstly, check that the value of the 'sessionid' cookie persists across requests. In IE, you can use the venerable Developer Toolbar to examine cookies. For example, IE is very particular about using `expires` rather than `max_age` to determine the lifetime of a cookie. Secondly, you might want to monitor the django_session table to check that the value of app is being saved by the first request. See the page I've linked to above for details on how to decode the data in the session hash. -- DR. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.