Tools, FAQ, Tutorials:
Using Cookies to Transfer Session IDs in PHP
How To Force the PHP Engine to Use Cookies to Transfer Session IDs in PHP?
✍: FYIcenter.com
If you want to force your PHP engine to use cookies to transfer session IDs instead of URL parameters, you can open the PHP configuration file, php.ini, and make the following changes:
session.use_cookies = 1 session.use_only_cookies = 1
Now re-run the first_page.php and next_page.php scripts presented in the previous tutorials. You will get something like:
Query string of the incoming URL: Cookies received: PHPSESSID = r66hq1bcg8o79e5i5gd52p26g3 Value of MyLogin has been retrieved: FYICenter Value of MyColor has been retrieved: Blue
Base on the output, your PHP engine is using cookies to transfer session IDs now, because you can see the cookie named as PHPSESSID contains the session ID, there is no URL parameters related to session ID.
⇒ Security of Storing Session ID as a Cookie in PHP
⇐ How Sessoion IDs Are Transferred in PHP
2016-10-25, 1291👍, 0💬
Popular Posts:
How To Read a File in Binary Mode in PHP? If you have a file that stores binary data, like an execut...
How to use the "set-body" Policy Statement for an Azure API service operation? The "set-body" Policy...
How To Read Data from Keyboard (Standard Input) in PHP? If you want to read data from the standard i...
How to install .NET Framework in Visual Studio Community 2017? I have the Visual Studio Installer in...
How to use urllib.parse.urlencode() function to encode HTTP POST data? My form data has special char...