here i saw you some basic difference between cookies and session.
- main difference is cookies are stored in user’s browser and session are not. this is the basic difference and is best to used.
- 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.
- in short cookies is stored in client side and session is stored in server side.
- session is expired when we closed our browser while cookie cant
- in session we getting problem is while closing browser session will expired.
this is the basic difference between cookies and session.