We all know that when session sessions have a cookie-based and URL-based two method of passing SessionID. In order to enable the client to prohibit the sending of cookies does not affect the customer landing site, you can set php.ini session.use_trans_sid=1, indicating when the client browser prohibits cookies, The links on the page are passed SessionID based on the URL. But a lot of people just set this option and did not achieve the effect, I also encountered this problem, later study found
There are two options in the php.ini file
Session.use_cookies=1
Session.use_only_cookies=1
A careful look at the English above will find its meaning.
Session.use_cookies indicates whether to start a session based on cookies
Session.use_only_cookies indicates whether to only open the session mode based on the cookie
Therefore, if you want to use cookies in a cookie-based manner when the browser opens the cookie, the following settings will be used when the cookie is not turned on (the most common way, recommended)
In the php.ini file
Session.use_trans_sid=1
Session.use_only_cookies=0
Session.use_cookies=1
Or in a PHP program.
Ini_set ("Session.use_trans_sid", "1″");
Ini_set ("Session.use_only_cookies", 0);
Ini_set ("Session.use_cookies", 1);
If the browser does not open the cookie, use the URL to do the following settings (this example mainly to illustrate the difference between setting session.use_only_cookies and Session.use_cookies)
In the php.ini file
Session.use_trans_sid=1
Session.use_only_cookies=0
Session.use_cookies=0
Or in a PHP program.
Ini_set ("Session.use_trans_sid", "1″");
Ini_set ("Session.use_only_cookies", 0);
Ini_set ("Session.use_cookies", 0);
Try it yourself and you'll understand the difference between session.use_only_cookies and session.use_cookies.
How the session is set after disabling cookies