What is the difference between Session and Cookie?

There are some differences between Session and Cookie .Following are the some difference:

  1. Sessions are stored on the server sides, and cookies are stored on the user’s computers in the text file format.
  2. Multiple variables ca not hold by cookies but Session can hold multiple variables.
  3. We can set expiry for a cookie and the session only remains active as long as the browser is open.
  4. Users do not have access the data you stored in Session since it is stored in the server.
  5. Session is used for login/logout purpose while cookies using for user activity tracking.

Leave a Reply

Your email address will not be published. Required fields are marked *

eight + 9 =