Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: What is Difference between Session and Cookie

by j3 (Friar)
on Mar 28, 2007 at 14:48 UTC ( [id://607035]=note: print w/replies, xml ) Need Help??


in reply to What is Difference between Session and Cookie

Remember, HTTP is a stateless protocol. Without adding any extra magic, if a user visits your site twice in a row, as far as the web server is concerned, those are two totally separate visits having nothing in common with eachother (save for coming from the same IP address).

If you want your web server to be able to remember users between pages they visit, you need some way to create a "session" -- some way to save information about the user so you can recognize them the next time they request a page.

The most common way to do this is by using cookies.

So, sessions are what you want, and cookies are most often how you get them.

  • Comment on Re: What is Difference between Session and Cookie

Replies are listed 'Best First'.
Re^2: What is Difference between Session and Cookie
by ikegami (Patriarch) on Mar 28, 2007 at 15:12 UTC

    save for coming from the same IP address

    Sometimes, not even that. Some people use load-balanced proxies, so requests don't always come from the same IP address. I believe AOL does this.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2024-09-15 14:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The PerlMonks site front end has:





    Results (21 votes). Check out past polls.

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.