main difference between session and cookies in php

main difference between session and cookies in php



main difference between  cookies and session,cookies are stored in the user's browser, and sessions are not. Sessions store in server maches,This difference determines what each is best used for.Cookies can keep information in the user's browser until deleted. If a person has a login and password, this can be set as a cookie in their browser so they do not have to re-login to your website every time they visit. You can store almost anything in a browser cookie. The trouble is that a user can block cookies or delete them at any time. If, for example, your website's shopping cart utilized cookies, and a person had their browser set to block them, then they could not shop at your website.