Tools, FAQ, Tutorials:
Receiving a Cookie from the Browser in PHP
How To Receive a Cookie from the Browser in PHP?
✍: FYIcenter.com
If you know that a cookie has been sent to the browser when it was visiting the server previously, you can check the built-in $_COOKIE array, which contains all cookies that were sent by the server previously. The script below shows you how to pickup one cookie from the $_COOKIE and loop through all cookies in $_COOKIE:
<?php
if (isset($_COOKIE["LoginName"])) {
$loginName = $_COOKIE["LoginName"];
print("Received a cookie named as LoginName: ".$loginName."\n");
} else {
print("Did not received any cookie named as LoginName.\n");
}
print("All cookies received:\n");
foreach ($_COOKIE as $name => $value) {
print " $name = $value\n";
}
?>
⇒ Testing Cookies on a Web Server in PHP
⇐ Sending a Cookie to the Browser in PHP
2016-11-04, ∼2994🔥, 0💬
Popular Posts:
Where to find tutorials on OpenID? Here is a large collection of tutorials to answer many frequently...
How to create a VC# class and build it into a library? If you want to create a VC# class and build i...
When using "@(...)" expressions in XML attributes as part of an policy statement, do I need to worry...
How to use the XML to JSON Conversion Tool at freeformatter.com? If you want to try the XML to JSON ...
Why I am getting "The Windows SDK version 8.1 was not found" error, when building my C++ application...