Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #11165

Re: Cookie Problem

References <SNT144-W9DE13AE9578823134D19FC7230@phx.gbl>
Date 2011-08-11 02:46 +0100
Subject Re: Cookie Problem
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.2136.1313027186.1164.python-list@python.org> (permalink)

Show all headers | View raw


On Thu, Aug 11, 2011 at 12:39 AM, Jack Hatterly
<jackhatterly@hotmail.com> wrote:
>     cookie['lastvisit'] = str(time.time())
>     cookie['lastvisit']['expires'] = 30 * 24 * 60 * 60
>     cookie['lastvisit']['path'] = '/var/www/html/my_site/'
>     cookie['lastvisit']['comment'] = 'holds the last user\'s visit date'
>     cookie['lastvisit']['domain'] = '.www.my_site.com'
>     cookie['lastvisit']['max-age'] = 30 * 24 * 60 * 60
>     cookie['lastvisit']['secure'] = ''
>     cookie['lastvisit']['version'] = 1

Some of these values look wrong. Your 'path' ought to be as the
browser sees it, and your 'domain' ditto; the only way that these
would make sense is if you're setting this cookie on a page such as:

http://foo.www.my_site.com/var/www/html/my_site/blah/blah

and you want to also see the cookie on the page:

http://bar.www.my_site.com/var/www/html/my_site/asdf/qwer

Otherwise, I would recommend omitting those elements and allowing the
defaults through.

ChrisA

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Cookie Problem Chris Angelico <rosuav@gmail.com> - 2011-08-11 02:46 +0100

csiph-web