Home > Backend Development > PHP Tutorial > The difference between php session and cookie_PHP tutorial

The difference between php session and cookie_PHP tutorial

WBOY
Release: 2016-07-13 10:31:21
Original
977 people have browsed it

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

www.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...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template