cookie is a text file that is stored on the client in name => value pairs to identify subsequent requests from the client by the server. Max. size of cookie file is 4k and it is stored on the client’s hard disk. Cookies are used as a mechanism to establish state and to track user behavior.

Disadvantages
* Data that is stored as a cookie is not secure
* Users can disable cookies on their client machine and hence it is not reliable

Session is a piece of identity (for e.g. a hash coded string) to establish state information by the server. Session information is served and stored by the server. A session’s life is the time during which the browser is kept open and it ceases to exist if the user logs out or closes the browser window. If the session was to be saved in folder, then that folder should not directory acess to prevent any mishap.