Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!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.023 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'python,': 0.02; 'charset:iso-8859-7': 0.04; 'insert': 0.05; 'that?': 0.05; 'cookie': 0.09; 'happens.': 0.09; 'http,': 0.09; 'bug': 0.12; 'changes': 0.15; 'elsewhere.': 0.16; 'expiring': 0.16; 'subject:when': 0.16; 'wrote:': 0.18; 'appears': 0.22; 'question': 0.24; 'asking': 0.27; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'possibility': 0.29; 'thus': 0.29; "doesn't": 0.30; 'message- id:@mail.gmail.com': 0.30; 'code': 0.31; 'another': 0.32; 'subject:from': 0.34; 'could': 0.34; 'except': 0.35; 'test': 0.35; 'received:google.com': 0.35; 'really': 0.36; 'entry': 0.36; 'example,': 0.37; 'whatever': 0.38; 'to:addr:python-list': 0.38; 'anything': 0.39; 'to:addr:python.org': 0.39; 'most': 0.60; 'identify': 0.61; 'new': 0.61; 'browser': 0.61; 'simply': 0.61; "you're": 0.61; 'situation': 0.65; 'webpage': 0.68; 'clicking': 0.73; 'unusual': 0.74; 'subject:gets': 0.84; 'visits': 0.84; 'luck': 0.93; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; bh=W8pEJ25xAZs0NF23gSa2YIGE5IrJtuYNHsQWdJtGcJ0=; b=fTPcYNipjjbVqPirYeQOdjsg5XLsH+dLsdEdn3gXlZ9aBEO0xtIQTFoJ4+/II9ghM0 6xsq0ngoG9DcqZ4Kq2zccxJkavVVeeBVV7Dr/soK8SE3mAb9h53VbzYA8UbVu+jU1tdK RJGa+zyml2WVAis+oBvswtXRCo/Z8QUOFjjxygSj1avbQB6Po13bNPj0hJC4ZOr2QreD Hkeh7bmlakPB0OvZSkyWvKJVXqr1T+TEcvMzmUdgXxLVTSwGggKXnE1KCIZQZWdl4Jbb Par6mBKD/wTxynRxOFYhCS7tVEH1wFDfSVVKHp9WPJbICbjaWFevguLu69zCgbyL2fvp 5S/w== X-Received: by 10.66.119.136 with SMTP id ku8mr2822112pab.121.1381230527121; Tue, 08 Oct 2013 04:08:47 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: From: Ian Kelly Date: Tue, 8 Oct 2013 05:08:06 -0600 Subject: Re: Cookie gets changed when hit comes from a referrer To: Python Content-Type: text/plain; charset=ISO-8859-7 Content-Transfer-Encoding: quoted-printable X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 22 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1381230535 news.xs4all.nl 15967 [2001:888:2000:d::a6]:55407 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:56387 On Tue, Oct 8, 2013 at 4:04 AM, =CD=DF=EA=EF=F2 =C1=EB=E5=EE=FC=F0=EF=F5=EB= =EF=F2 wrote: > I use this code to retrive or set a cookie to the visitor's browser if > present and identify him bu it. > > All work well except the situation where the user visits my webpage by > clicking a backlink on another wbpage. > > Then for some reason the cookieID changes to another value thus a new ent= ry > appears into the database when insert happens. > > What cna i do about that? This question is really about HTTP, not Python, so you'd have better luck asking elsewhere. The most likely possibility is that the domain doesn't match. For example, the cookie is set for the domain www.foo.com, and the other webpage is linking to foo.com. Another possibility is that the cookie is expiring because the browser session was terminated, not because of anything to do with the other webpage. Or it could simply be a bug or unusual setting in whatever browser you're using to test it.