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


Groups > comp.lang.python > #11165

Re: Cookie Problem

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.047
X-Spam-Evidence '*H*': 0.91; '*S*': 0.00; 'defaults': 0.07; 'subject:Problem': 0.09; 'through.': 0.09; 'am,': 0.12; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'omitting': 0.16; 'sees': 0.16; 'wrote:': 0.16; 'otherwise,': 0.19; 'header:In-Reply-To:1': 0.22; 'aug': 0.24; 'thu,': 0.28; 'elements': 0.29; 'message-id:@mail.gmail.com': 0.29; "skip:' 10": 0.30; '\xa0\xa0\xa0': 0.31; 'values': 0.32; 'to:addr:python-list': 0.33; 'setting': 0.34; 'page': 0.37; 'some': 0.38; 'received:google.com': 0.38; 'received:209.85': 0.38; 'subject:: ': 0.39; 'to:addr:python.org': 0.39; 'sense': 0.39; 'page:': 0.40; 'your': 0.61; 'browser': 0.61; 'visit': 0.67; '11,': 0.68; 'as:': 0.70; '12:39': 0.84; 'url:var': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=lnAponRIBxrbIgSbrGhBas0R0h5uWsjYXaG7vt+KPbc=; b=B4jOg8cJ2bzj6l/zh2VBaNn4+Gc1KjWgXbFyXMuVmjviuCgK/KtuI/6FR+AHDkIbeK ov58NKgXf6env8VOneKFDqDepfi+qkoFGPSCkb++70HaMLqrTSVaJFaqQhDSQToEQKaS V2eUx868E35dhillt0faqzxu0iwUSxTWhfZ68=
MIME-Version 1.0
In-Reply-To <SNT144-W9DE13AE9578823134D19FC7230@phx.gbl>
References <SNT144-W9DE13AE9578823134D19FC7230@phx.gbl>
Date Thu, 11 Aug 2011 02:46:23 +0100
Subject Re: Cookie Problem
From Chris Angelico <rosuav@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding quoted-printable
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.2136.1313027186.1164.python-list@python.org> (permalink)
Lines 26
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1313027186 news.xs4all.nl 23939 [2001:888:2000:d::a6]:50550
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:11165

Show key headers only | 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