What is the difference between cookies and session?

Answer Posted / aruna jyothi

Cookies
1. Cookies can store only "string" datatype
2. They are stored at Client side
3. Cookie is non-secure since stored in text format at
client side
4. Cookies may or may not be individual for every
client
5. Due to cookies network traffic will increase.Size
of cookie is limited to 40 and number of cookies to be used
is restricted to 20.
6. Only in few situations we can use cookies because
of no security
7. We can disable cookies
8. Since the value is string there is no security
9. We have persistent and non-persistent cookies

Session
1. Session can store any type of data because the
value is of datatype of "object"
2. These are stored at Server side
3. Session are secure because it is stored in binary
format/encrypted form and it gets decrypted at server
4. Session is independent for every client i.e
individual for every client
5. There is no limitation on size or number of
sessions to be used in an application
6. For all conditions/situations we can use sessions
7. we cannot disable the sessions.Sessions can be used
without cookies also(by disabling cookies)
8. The disadvantage of session is that it is a
burden/overhead on server
9. Sessions are called as Non-Persistent cookies
because its life time can be set manually

Is This Answer Correct ?    255 Yes 18 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how to compare numbers and dispaly the largest ? *first thing I wanted to do is to input how many numbers to be compared *and then analyzed the largest then display it.

1279


What is a strong name in c#?

802


Does main have to be static c#?

486


Which is faster list or dictionary in c#?

565


What is thread safe in c#?

488






What is func delegate in c#?

501


Why do we use yield in c#?

500


What is a class level variable in c#?

491


What is difference between throw and throws in c#?

448


How do I know if executenonquery is successful c#?

443


How to add a readonly property in c#.net

492


Define thread? Explain about multithreading?

564


What is toint32 c#?

616


Is c# still popular?

483


How do I create a .exe file?

480