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