Co-Authored By:
Considering this, what is difference between session and cookie?
Cookies and Sessions are used to storeinformation. Cookies are only stored on the client-sidemachine, while sessions get stored on the client as well asa server. A session creates a file in a temporarydirectory on the server where registered session variablesand their values are stored.
Similarly, you may ask, which is more secure cookie or session?
Actually, technically cookies are moresecure than sessions are. Since sessions arebased on cookies they can only be as secure ascookies are, and almost always less secure than that.However, unless you have a very good implementation,sessions will be safer for you.
Cookies can be used for session state.Cookies are small pieces of text, stored on the client'scomputer to be used only by the website setting the cookies.This allows webapplications to save information for the user, andthen re-use it on each page if needed. Every sessionwill have SessionID.