Developer community
0 votes
asked by Guru (24.6k points) 30 54 84 | 33 views

2 Answers

0 votes
The main difference between sessions and cookies is that sessions are stored on the server, and cookies are stored on the user’s computers in the text file format. Cookies can not hold multiple variables,But Session can hold multiple variables.We can set expiry for a cookie,The session only remains active as long as the browser is open.Users do not have access to the data you stored in Session,Since it is stored in the server.Session is mainly used for login/logout purpose while cookies using for user activity tracking.
answered by Guru (39.1k points) 10 22 36
0 votes
1)Session is stored in server but cookie stored in client.

 2)Session should work regardless of the settings on the client browser.

3)There is no limit on the amount of data that can be stored on session. But it is limited in cookie.

4)Session can store objects and cookies can store only strings. Cookies are faster than session.
answered by Geek (15.3k points) 17 43 67

Related questions

0 votes
1 answer
asked by sara Guru (24.6k points) 30 54 84 | 19 views
0 votes
1 answer
asked by sara Guru (24.6k points) 30 54 84 | 46 views
0 votes
1 answer
asked by smith Geek (15.3k points) 17 43 67 | 53 views
0 votes
2 answers
asked by smith Geek (15.3k points) 17 43 67 | 33 views
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true


C Books Guide and List
C++ Books Guide and List
Best Java Books

3.8k questions

4k answers


10.7k users

3,754 questions
4,046 answers
10,709 users