The difference between a cookie and a session in PHP:
1. The cookie data is stored on the client's browser and the session data is placed on the server.
2, the cookie is not very safe, others can be stored in the local cookie and cookie spoofing, considering that security should use the session.
3. Session will be saved on the server for a certain period of time. When the number of accesses increases, the performance of your server will be compared, and cookies should be used in consideration of mitigating server performance.
4, the limit of a single cookie on the client is 3K, that is, a site in the client store cookies can not be 3 K.
So personal advice: the login information and other important information stored as a session, other information if necessary to retain, can be placed in a cookie .
Articles you may be interested in
- The difference between PHP require and include
- PhpMyAdmin cannot start session without errors error resolution
- The difference and usage of return and exit, break and Contiue in PHP
- The usage and difference of echo,print,print_r,var_export,var_dump in PHP
- Usage and differences in PHP that jump out of multiple loops using Break,continue,goto,return,exit
- PHP Output Control In-depth understanding of the difference between Ob_flush and flush
- Window.navigate and window.location.href the use of different explanations
- PHP empty,is_null,isset The difference between the detailed
http://www.bkjia.com/PHPjc/764111.html www.bkjia.com true http://www.bkjia.com/PHPjc/764111.html techarticle the difference between a cookie and a session in PHP: 1. The cookie data is stored on the client's browser and the session data is placed on the server. 2, the cookie is not very safe, others can be analyzed stored in the local ...