: This article describes how to set session after cookie disabling. For more information about PHP tutorials, see. We all know that in a session, there are two methods for passing SESSIONID based on cookie and url. To prevent sending cookies on the client and prevent customers from logging on to the website, you can set php. session in ini. use_trans_sid = 1, indicating that when the client browser disables cookie, the link on the page will pass the SESSIONID based on the url. However, many people set this option but it does not work. I also encountered this problem. later studies found that
The php. ini file also has two options.
Session. use_cookies = 1
Session. use _> think carefully about the English above and you will find its meaning.
Session. use_cookies indicates whether to start cookie-based session.
Session. use_only_cookies indicates whether to enable the cookie-based session method only.
Therefore, if you want to use the cookie-based method when enabling the cookie in the browser, use the url method when enabling the cookie as follows (the most common method is recommended)
In the php. ini file
Session. use_trans_sid = 1
Session. use _> 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 url is used regardless of whether or not the browser enables cookies (this example mainly describes 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 a php program
Ini_set ("session. use_trans_sid", "1 ″);
Ini_set ("session. use_only_cookies", 0 );
Ini_set ("session. use_cookies", 0 );
By yourself, you will understand the differences between session. use_only_cookies and session. use_cookies.
The preceding section describes how to set session after cookie disabling, including related content, and hopes to help friends who are interested in PHP tutorials.