Difference Between Cookies and Session

Hello friends,

here i saw you some basic difference between cookies and session.

  1. main difference is cookies are stored in user’s browser and session are not. this is the basic difference and is best to used.
  2. cookie can store information in the user’s browser untill user cannot delete. sometimes we can see Remember me option in many website. suppose in any website we have login at that time we have select Remember me option i.e our login credential is storing in our browsers.  so next time we login no need to reenter our password if we have checked Remember me option and that is the cookie.
  3. in short cookies is stored in client side and session is stored in server side.
  4. session is expired when we closed our browser while cookie cant
  5. in session we getting problem is while closing browser session will expired.

this is the basic difference between cookies and session.