>
> You need to send the 'sessionid'. It's in request.COOKIES.
Thanks for the quick reply, Jashugan.
So I have to send the sessionid in the HttpResponse back to the client
for it to use, right? I tried getting it from the Request object
after I successfully logged in. But it wasn't in the COOKIES
dictionary.
def login(request):
username = request.POST['username']
password = request.POST['password']
try:
user = authenticate(username=username, password=password)
if user is not None:
if user.is_active:
try:
django.contrib.auth.login(request, user)
logging.debug('Logged in user ' + username)
aSessionId = request.COOKIES['sessionid']
# the above call caused a "KeyError('sessionid',)"
error.
...
Where do I get the sessionid to send back to the client so that I can
send it on subsequent requests? Also - I'm creating my HTTP request
using the GWT RequestBuilder (basically creating my own HTTP
request). What header name do I use for the session id so that django
will see it as a cookie value?
Thanks again for your help.
--jarmo
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---