Hi Adam,
Try running this on the dev server:
class MainHandler(webapp.RequestHandler):
def get(self):
# This works fine for me, of course you need to refresh the
page to get the previously set cookie.
self.response.headers.add_header('Set-Cookie', '[email protected]')
self.response.out.write(self.request.cookies.get('email'))
# On the dev server this works fine for me.
self.response.out.write(self.request.cookies.get('dev_appserver_login'))
Robert
On Wed, May 19, 2010 at 5:08 AM, adamea <[email protected]> wrote:
> Ok now I am having trouble reading the cookie. This code doesn't work:
>
> cookie = self.request.cookies.get("email", '')
>
> Any ideas?
>
> Adam
>
>
> On May 19, 9:59 am, adamea <[email protected]> wrote:
>> Solved.
>>
>> self.response.headers.add_header(
>> 'Set-Cookie', '[email protected];
>> expires=31-Dec-2020
>> 23:59:59 GMT')
>>
>> Adam
>>
>> On May 19, 9:52 am,adamea<[email protected]> wrote:
>>
>>
>>
>>
>>
>> > Hello
>>
>> > I have searched far and wide trying to find a solution to this problem
>> > but have not found anything that works. I am trying to set a cookie
>> > within a Python script running the webapp framework on App Engine.
>>
>> > What is the best way to do to this? Any example code and the place
>> > where the code should go is appreciated.
>>
>> > Thanks
>> > Adam
>>
>> > --
>> > You received this message because you are subscribed to the Google Groups
>> > "Google App Engine" 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
>> > athttp://groups.google.com/group/google-appengine?hl=en.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google App Engine" 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
>> athttp://groups.google.com/group/google-appengine?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" 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/google-appengine?hl=en.
>
>
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" 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/google-appengine?hl=en.