What is the Difference Between a Cookie and a Session Object in Java ?

Both Cookie and Session are used during communication between Client and Server. The Client can disable a Cookie. Due to which the Web server cannot send a cookie. But a client cannot disable a session. So a Session always works irrespective of any setting at the client side.

Also a Session can store any Java object. But the Cookie can only store small information in a String object.



You May Interest

What are the Rules of Method Overloading and Method Overriding in ...

What is the Difference Between JDK And JRE ?

What are the Differences Between a Vector and an ArrayList in Jav ...

How Can You Make an Object Eligible for Garbage Collection in Jav ...

How Strategy Design Pattern is Different From State Design Patter ...