Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Implementing Cookies

by Nomis52 (Friar)
on Nov 20, 2001 at 03:14 UTC ( [id://126416]=note: print w/replies, xml ) Need Help??


in reply to Implementing Cookies

I wouldn't use IP addresses for tracking users ( or session ids based on them for that matter) as they can change between visits for returning users (for those of us on dial up accounts). Apparently they even change between page requests for aol users due to proxys.Also with the use of proxys many users could be seen to originate from the 1 IP address.

I'd generate as session ID , fairly long and random , and store it as the key to a DB and in the cookie.

Then when the user visits lookup the key in the DB and get/set any info that you need to.

Replies are listed 'Best First'.
Re: Re: Implementing Cookies
by drifter (Scribe) on Nov 20, 2001 at 17:25 UTC
    Yes, this is the way I solved a similar problem, I used Apache::Session::Generate::MD5 to get random enough data, but I guess "there's more then one way to do it". Just keep in mind that Cookies have a limit of chars they can hold in the value field which is AFAIK 255, so creating too long random data might not be what you want.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://126416]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2024-04-23 11:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found