Django

Code

Ticket #7183 (new)

Opened 5 days ago

sessionid broken by jsession

Reported by: mbeattie Assigned to: nobody
Component: HTTP handling Version: SVN
Keywords: wsgi session Cc:
Triage Stage: Unreviewed Has patch: 1
Needs documentation: Needs tests:
Patch needs improvement:

Description

I was trying to use a django setup on a machine that used to have a j2ee setup and whenever I tried to use any of the session

functionality it would give an error saying that the key I was looking for wasn't found. I figured out that the problem is

for some reason once a particular jsessionid is set, firefox will hold on to it forever for that host and always send it as

part of the HTTP_COOKIE. The way to fix it is to clear the cookies for that host. I am not too sure what the real cause of

this is or what belongs in HTTP_COOKIE, but I found a way to make it go away by modifying wsgi.py. It seems that django only

cares about the sessionid part of that header so that's all I grabbed. Someone more knowledgeable about why this happens

might have something better.

13a14

import re

147c148,153 < self._cookies = http.parse_cookie(self.environ.get('HTTP_COOKIE', )) ---

cookiestring = self.environ.get('HTTP_COOKIE', ) sessionfind = re.search("(sessionid=[0-9a-f]*)", cookiestring) if sessionfind == None: self._cookies = http.parse_cookie(cookiestring) else: self._cookies = http.parse_cookie(sessionfind.groups()[0])

Attachments

wsgipatch.txt (473 bytes) - added by mbeattie on 05/06/08 19:58:53.
my patch

Change History

05/06/08 19:58:53 changed by mbeattie

  • attachment wsgipatch.txt added.

my patch


Add/Change #7183 (sessionid broken by jsession)




Change Properties
Action