Tuesday, December 20, 2011

What is the difference between session and cookies?

What is the difference between session and cookies?|||Session is assgined at server site while cookies at client side|||Cookies are saved on the client side (in the browser).


Session is saved on the server.





Users can delete, or even change cookies.


Users can't (unless something is really wrong) change session state.





Cookies can last a long time, and survive a server reboot.


Session state may expire or be lost at most any time.





You can store more stuff in session state, in general. And it's usually easier.|||Session is stored on the server-side, only lasts as long as the browser session. Cookies are stored on the users computer, and are often used when they need to last longer than the browser session.

No comments:

Post a Comment