Ok, a little progress on this. This is what is currently happening :
I have no cookies. I go to the login page. No cookies are set. I submit
the page. The test cookie is checked as part of that request. It fails.
A session is still started however, and a sessionid cookie is set.
set_test_cookie on SessionWrapper is not getting called. When should it
be getting called? As I say, after the first page view, I have not had a
session started for me. Should I have?
Mike
It appears that when
Mike H wrote:
> Hi Malcolm,
>
> I'm more than willing to help track down the error (as if I dont get it
> fixed, I cant use Django! Asking customers to log in twice wont go down
> well...)
>
> I have a question though : After the first load of the login page,
> should a session have been started for me? Or does the session only get
> started once i submit the login form?
>
> Cheers,
>
> Mike
>
> Malcolm Tredinnick wrote:
>
>> On Sat, 2007-06-09 at 15:48 +0100, Mike H wrote:
>>
>>
>>> Hi,
>>>
>>> I'm trying to use the provided login view for my new application,
>>> but whenever I use it, the first time i submit the login request,
>>> AuthenticationForm returns the error
>>> "Your Web browser doesn't appear to have cookies enabled. Cookies are
>>> required for logging in."
>>>
>>> The second time i submit the login, it works. Obviously, I do
>>> have cookies enabled. I have tried it in multiple browsers also
>>> and get exactly the same behaviour (IE6, Firefox, Opera and Konqueror).
>>>
>>> My urls look like this :
>>>
>>> from django.contrib.auth.views import login
>>> urlpatterns = patterns('',
>>> (r'^login/$', login, {'template_name':
>>> 'registration/login.html'}),
>>> (r'^logout/$', logout, {'template_name':
>>> 'registration/logout.html'}),
>>> )
>>>
>>>
>> People report this problem from time to time. I've never seen a good
>> explanation or diagnosis of why it happens. It is a complete mystery to
>> me.
>>
>> One day, hopefully, somebody who is seeing the error will have the
>> enthusiasm to really try and debug what's going on by putting debugging
>> prints into various places in Django to see what it is sending out and
>> probably hooking up a network sniffer like Wireshark to also look at the
>> TCP traffic between the browser and the server.
>>
>> Regards,
>> Malcolm
>>
>>
>>
>>
>>
>>
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" 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-users?hl=en
-~----------~----~----~----~------~----~------~--~---