Cookie gets changed when hit comes from a referrer

Νίκος Αλεξόπουλος nikos.gr33k at gmail.com
Tue Oct 8 10:18:12 EDT 2013


Στις 8/10/2013 2:08 μμ, ο/η Ian Kelly έγραψε:
> On Tue, Oct 8, 2013 at 4:04 AM, Νίκος Αλεξόπουλος <nikos.gr33k at gmail.com> 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 entry
>> 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.
>

When i direct hit http://superhost.gr the cookie remains the same it is 
not lost.

Also i have set:
ookie['ID']['expires'] = 60*60*24*365		#this cookie will expire in a year

but that didnt also help much because the cookie is also changing when 
the hit comes through a referrer.

So, i cannot se the cookie down to its feet my whole insert or update 
procedure breaks and i have duplicate entried for the same hostnames.

Where shoudl i rely to identify a visitor?
I was relying on tis hostname(although i know that after a router reset) 
it changes, and then couple days ago i was thiking of relying to a 
cookie that i would/set retrive from the vistirs browser, but if it 
changes all the time i cannot evan rely to that.

-- 
What is now proved was at first only imagined! & WebHost
<http://superhost.gr>



More information about the Python-list mailing list