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, ∼2272🔥, 0💬
Popular Posts:
How to pull NVIDIA CUDA Docker Image with the "docker image pull nvidia/cuda" command? If you are ru...
How to use "{{...}}" Liquid Codes in "set-body" Policy Statement? The "{{...}}" Liquid Codes in "set...
How to access Query String parameters from "context.Request.Url.Que ry"object in Azure API Policy? Q...
How to read RSS validation errors at w3.org? If your RSS feed has errors, the RSS validator at w3.or...
How to use the "return-response" Policy statement to build the response from scratch for an Azure AP...