Hi guys,

I'm having a strange problem with sessions not storing anything that I
haven't encountered before. For example, the simple test below outputs
"Worked?: False" even though the headers seem to show cookies working
quite nicely. The admin interface also outputs a message saying that
cookies aren't enabled, even though they are. Rows seem to be inserted
into the django_session table as expected.

I'm using the svn revision 6048 of Django on Debian testing (earlier
tries with v0.96 didn't seem to work either). Apache is v2.2-3-5 and
mod_python v3.3.1-1, both standard Debian packages. Any pointers?

Thanks in advance,

-Johannes


The views:
----------

from django.http import HttpResponse, HttpResponseRedirect

def test1(r):
    r.session.set_test_cookie()
    return HttpResponseRedirect('/kysely/test2/')

def test2(r):
    return HttpResponse('Worked?: %s' %
r.session.test_cookie_worked()) # outputs 'Worked?: False'


The relevant headers ('sessionid' refers to an unrelated PHP webapp on
the same domain; 'django_session_id' is the Django cookie name
assigned in settings.py):
---------------------

http://digit.fi/kysely/test1/
GET /kysely/test1/ HTTP/1.1
Host: digit.fi
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.6) Gecko/
20060601 Firefox/2.0.0.6 (Ubuntu-edgy)
Accept: text/xml,application/xml,application/xhtml+xml,text/
html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Cookie: sessionid=0000000009508d05730272305f92e056;
foodlistsOpen=true; foodListOptions=;
django_session_id=000000007d68ebc53ed03324cf62ab72

HTTP/1.x 302 Found
Date: Mon, 24 Sep 2007 16:35:21 GMT
Server: Apache/2.2.3 (Debian) mod_python/3.3.1 Python/2.4.4 PHP/
4.4.4-9 mod_perl/2.0.2 Perl/v5.8.8
Vary: Cookie
Location: /kysely/test2/
Set-Cookie: django_session_id=000000000f427ae38135df56c8f24375;
Domain=.digit.fi; expires=Mon, 08-Oct-2007 16:35:21 GMT; Max-
Age=1209600; Path=/;
Content-Length: 0
Keep-Alive: timeout=15, max=97
Connection: Keep-Alive
Content-Type: text/html; charset=utf-8
----------------------------------------------------------
http://digit.fi/kysely/test2/

GET /kysely/test2/ HTTP/1.1
Host: digit.fi
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.6) Gecko/
20060601 Firefox/2.0.0.6 (Ubuntu-edgy)
Accept: text/xml,application/xml,application/xhtml+xml,text/
html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Cookie: sessionid=0000000009508d05730272305f92e056;
foodlistsOpen=true; foodListOptions=;
django_session_id=000000000f427ae38135df56c8f24375

HTTP/1.x 200 OK
Date: Mon, 24 Sep 2007 16:35:21 GMT
Server: Apache/2.2.3 (Debian) mod_python/3.3.1 Python/2.4.4 PHP/
4.4.4-9 mod_perl/2.0.2 Perl/v5.8.8
Vary: Cookie
Set-Cookie: django_session_id=00000000fd517bd7d5333c2f04592c26;
Domain=.digit.fi; expires=Mon, 08-Oct-2007 16:35:21 GMT; Max-
Age=1209600; Path=/;
Keep-Alive: timeout=15, max=96
Connection: Keep-Alive
Transfer-Encoding: chunked
 Content-Type: text/html; charset=utf-8
 ----------------------------------------------------------


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to