Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
How To Specify Domain and Path for a Cookie
How To Specify Domain and Path for a Cookie? - PHP Script Tips - Understanding and Managing Cookies
✍: 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");
?>
2007-04-24, 5148👍, 0💬
Popular Posts:
How To Delete All Rows a Table? - MySQL FAQs - Understanding SQL INSERT, UPDATE and DELETE Statement...
Can you prevent a class from overriding ? If you define a class as “Sealed” in C# and “NotInheritab...
.NET INTERVIEW QUESTIONS - How can you avoid deadlock in threading? A good and careful planning can ...
How To Merge Cells in a Column? - XHTML 1.0 Tutorials - Understanding Tables and Table Cells If you ...
What are the high-level thread states? The high-level thread states are ready, running, waiting, and...