PHP client Disable cookie how to use session

Source: Internet
Author: User
PHP client Disable cookie how to use session

The first way: Add a phpsessid= on each of the hyperlinks $sid

Prevents the return of the initial page from generating a new session
if (Isset ($_get["Phpsessid")) {
session_id ($_get["PHPSESSID"]);
}
Start a session
Session_Start ();
Gets the session_id () of the current session
$sid =session_id ();
Add the parameter phpsessid= on each link $sid

Other pages are obtained in the following ways:
if (Isset ($_get["Phpsessid")) {
Set the current session to be the initial session,session_id () consistent
session_id ($_get["PHPSESSID"])
}
Session_Start ();

The second way: replace the phpsessid= $sid on the link with the SID constant (the value of the SID is similar: PHPSESSID=SDDG34R593DFDLKSREWR)
if (Isset ($_get["Phpsessid")) {
session_id ($_get["PHPSESSID"]);
}
Start a session
Session_Start ();


Other pages are obtained in the following ways:
if (Isset ($_get["Phpsessid")) {
Set the current session to be the initial session,session_id () consistent
session_id ($_get["PHPSESSID"])
}
Session_Start ();

The Third Way: Configure using Session.use_trans_sid=1,php.ini
This way the URL is automatically added to the SID (Href,location,action, note: JS Jump is not added on the SID)

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.