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: 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: References: Date: Thu, 11 Aug 2011 02:46:23 +0100 Subject: Re: Cookie Problem From: Chris Angelico 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: 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 On Thu, Aug 11, 2011 at 12:39 AM, Jack Hatterly wrote: > =A0=A0=A0 cookie['lastvisit'] =3D str(time.time()) > =A0=A0=A0 cookie['lastvisit']['expires'] =3D 30 * 24 * 60 * 60 > =A0=A0=A0 cookie['lastvisit']['path'] =3D '/var/www/html/my_site/' > =A0=A0=A0 cookie['lastvisit']['comment'] =3D 'holds the last user\'s visi= t date' > =A0=A0=A0 cookie['lastvisit']['domain'] =3D '.www.my_site.com' > =A0=A0=A0 cookie['lastvisit']['max-age'] =3D 30 * 24 * 60 * 60 > =A0=A0=A0 cookie['lastvisit']['secure'] =3D '' > =A0=A0=A0 cookie['lastvisit']['version'] =3D 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