Can the Session still be used if Cookie is disabled?

怪我咯
Release: 2023-03-07 10:28:01
Original
1531 people have browsed it

Cookie and Session

are generally considered to be two independent things. Session uses The server-side maintains state scheme, while Cookie adopts a client-side scheme of maintaining state. Cookies are divided into two types, one can be called session cookie, which will be lost when the browser is closed, and the other can...


Cookie and Session are generally considered to be two As independent things, Session uses a solution that maintains state on the server side, while Cookie uses a solution that maintains state on the client side.
Cookies are divided into two types. One can be called a session cookie, which will be lost when the browser is closed. The other can be called a persistent cookie, which is what we usually call cookies, usually server-side sessions. It uses the seesion cookie to interact with the client.

#For PHP, what should we do if the client turns off cookies?

  • Set "session.use_trans_sid = 1" in the php.iniconfig file, or turn on "--enable" when compiling -trans-sid" option, let PHP automatically pass the Session ID across pages.

  • Manually pass the value through the URL, and pass the Session ID through the hidden form.

  • #Save the Session ID in a file, database, etc., and call it manually during the cross-page process. ​ ​ ​

The above is the detailed content of Can the Session still be used if Cookie is disabled?. For more information, please follow other related articles on the PHP Chinese website!

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!