Cookie gets changed when hit comes from a referrer

Ian Kelly ian.g.kelly at gmail.com
Tue Oct 8 07:08:06 EDT 2013


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.



More information about the Python-list mailing list