WHAT IS THE DIFFERENCE BETWEEN COOKIES AND SESSION?

Anurag Sharma

Total Post:40

Points:280
Posted by  Anurag Sharma
 1398  View(s)
Ratings:
Rate this:

What is the difference between cookies and session?
please provide me any sample of code and concept.

Thanks, Anurag

  1. Alex R

    Post:40

    Points:280
    Re: What is the difference between cookies and session?

    Hi Anurag,

    The main difference between cookies and sessions is that cookies are stored in the user's browser, and sessions are not.

    A session is available as long as the browser is opened while A cookie can keep information in the user's browser until deleted.

    User can block cookies or delete them at any time while Sessions are not reliant on the user allowing a cookie. They work instead like a token allowing access and passing information while the user has their browser open.

    For creating cookies you can read this link.
    http://www.mindstick.com/Articles/c4e253f5-67dc-4211-8a1f-e29c17ce2943/

    For details about creating and using Session visit this link.
    http://www.mindstick.com/Articles/273b0c21-a027-46ec-8c84-ad4e05c62b23/

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!