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:
What Is the Common Mistake When Setting Path and Domain on Temporary Cookies
What Is the Common Mistake When Setting Path and Domain on Temporary Cookies? - PHP Script Tips - Understanding and Managing Cookies
✍: FYIcenter.com
A common mistake made by many PHP developers is using an empty string for the expiration time parameter when setting path and domain for temporary cookies. The PHP script below shows an example of this mistake:
<?php # Incorrect use of setcookie() setcookie("LoginName","FYICenter", "", "/", ".fyicenter.com"); # Correct use of setcookie() setcookie("PreferredColor","Blue", NULL, "/", ".fyicenter.com"); ?>
If you run this script, you will get an error:
PHP Warning: setcookie() expects parameter 3 to be long, string given in \php_working_with_cookies.php on line 3
2007-04-24, 4803👍, 0💬
Popular Posts:
Can one change the mouse pointer in Forms? The SET_APPLICATION_PROPERTY build-in in Oracle Forms all...
Describe in detail Basic of SAO architecture of Remoting? For these types of questions interviewer e...
Explain all parts of a deployment diagram? Package: It logically groups element of a UML model. Node...
How To Get the Last ID Assigned by MySQL? - MySQL FAQs - Managing Tables and Running Queries with PH...
.NET INTERVIEW QUESTIONS - What is COM ? Microsoft’s COM is a technology for component software deve...