Home  >  Article  >  Backend Development  >  Can the Session still be used if Cookie is disabled?

Can the Session still be used if Cookie is disabled?

怪我咯
怪我咯Original
2017-04-05 09:43:021527browse

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!

Statement:
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