views:

240

answers:

2

I am not able to set cookies using following statements

  self.request.headers['Cookie'] = 'uniqueid = ',unique_identifier
  self.request.headers['Cookie'] = 'nickname = ',nickname

as self.request.cookies

is returning null dictionary in another request.

environment is python on google app engine

+4  A: 

Changing the cookies in the request does nothing to the cookie on the client.

You need to set the "Set-Cookie" header in the response to the client.

You could use something like this (untested by me) Google App Engine Cookie class

jitter
It is not getting set although theoretically it should
dhaval
+2  A: 

The WebOb Reference explains set_cookie well - if youre on a framework using the WebOb Response (not valid for Google App Engine, it uses an own Repsonse)

Jens W. Klein