Tools, FAQ, Tutorials:
Specifying Domain and Path for a Cookie in PHP
How To Specify Domain and Path for a Cookie in PHP?
✍: FYIcenter.com
If you want to specify domain and path for cookie, you can use the setcookie() function with two extra parameters. The sample PHP script below shows you how to set the domain and path attributes for temporary and persistent cookies:
<?php
setcookie("LoginName","FYICenter", NULL, "/", ".fyicenter.com");
setcookie("PreferredColor","Blue", NULL, "/", ".fyicenter.com");
setcookie("CouponNumber","07470433",time()+60*60*24*7,
"/store", ".fyicenter.com");
setcookie("CouponValue","100.00",time()+60*60*24*7,
"/store", ".fyicenter.com");
print("2 temporary cookies were delivered.\n");
print("2 consistent cookies were delivered.\n");
?>
⇒ Mistake on Setting Cookie Path and Domain in PHP
⇐ Domain and Path Attributes for Cookies in PHP
2016-11-03, ∼2845🔥, 0💬
Popular Posts:
Where to find tutorials on JSON (JavaScript Object Notation) text string format? I want to know how ...
How To Read Data from Keyboard (Standard Input) in PHP? If you want to read data from the standard i...
Where to get the detailed description of the JSON.stringify() Function in JavaScript? Here is the de...
How to dump (or encode, serialize) a Python object into a JSON string using json.dumps()? The json.d...
How to Instantiate Chaincode on BYFN Channel? You can follow this tutorial to Instantiate Chaincode ...