We all know that there are two ways to pass SESSIONID in the session based on cookie and url. In order to prevent the client from sending cookies without affecting the customer's login to the website, you can set session.use_trans_sid=1 in php.ini, which means that when the client browser disables cookies, the links on the page will pass the SESSIONID based on the URL. However, many people only set this option and it did not achieve the effect. I also encountered this problem. After some research, I found that there are two options in the php.ini file
session.use_cookies=1
session.use_> Think about it carefully You will find the meaning of the above English
session.use_cookies indicates whether to start a session based on cookies
session.use_only_cookies indicates whether to only open a session based on cookies
In the php.ini file
session.use_trans_sid=1
session.use_>session.use_cookies=1
Or in the php program
ini_set("session.use_trans_sid","1");
ini_set("session.use_only_cookies",0);
ini_set("session.use_cookies",1);
If it doesn’t matter whether the browser is turned on or not Cookies are set as follows using URL (this example mainly wants to explain the difference between setting session.use_only_cookies and session.use_cookies)
In the php.ini file
session.use_trans_sid=1
session.use_>session.use_cookies =0
Or in php program
ini_set("session.use_trans_sid","1");
ini_set("session.use_only_cookies",0);
ini_set("session.use_cookies",0);
The above introduces how to set up the session after disabling cookies, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.