The difference between cookie and session in php:
1. Cookie data is stored on the customer's browser, and session data is placed on the server.
2. Cookies are not very safe. Others can analyze the cookies stored locally and deceive them. Sessions should be used for security reasons.
3. The session will be saved on the server within a certain period of time. When access increases, it will take up more of your server's performance. In order to reduce server performance, COOKIE should be used.
4. The limit of a single cookie on the client is 3K, which means that a website cannot store 3K COOKIES on the client.
So personal suggestion: Store important information such as login information as SESSION. If other information needs to be retained, it can be placed in COOKIE .
Articles you may be interested in
- The difference between php require and include
- phpMyAdmin Cannot start session without errors error solution
- PHP The difference and usage between return and exit, break and contiue
- The usage and difference between echo, print, print_r, var_export, var_dump in PHP
- Use break, continue, goto, return to jump out of multiple loops in PHP , the usage and difference of exit
- php Output Control In-depth understanding of the difference between ob_flush and flush
- Detailed explanation of the difference between window.navigate and window.location.href
- empty in php Detailed explanation of the difference between ,is_null and isset
http://www.bkjia.com/PHPjc/764111.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/764111.htmlTechArticleThe difference between cookie and session in php: 1. Cookie data is stored in the customer's browser, and session data is stored in on the server. 2. Cookies are not very secure. Others can analyze and store them locally...