|
|
Php Set Raw Cookie Function
|
Tutorials » Php »
|
Topic |
What is Setrawcookie Function?
|
|
Explanation |
|
The "Setrawcookie" function sends an HTTP cookie without URL encoding the cookie value.
Syntax:
setrawcookie(name,value,expire,path,domain,secure)
In the above syntax "name" specifies the name of the cookie, "value" specifies the value of the cookie,
"expire" specifies when the cookie expires, "path" specifies the server path of the cookie, "domain" specifies
the domain name of the cookie,"secure" specifies whether a cookie should be transmitted or not over a secure connection.
Example:
<?php
$value = "this cookie value";
setrawcookie("TestCookie",$value, time()+3600*24);
?>
In the above example a string is assigned to the simple cookie, and the cookie is set a expiry time of 24 hours.
|
|
A Note |
Learn PHP programming language tutorial with simple and neat example. Hope you enjoy this free tutorial.
Do give us your valuable feedback and suggestions on this online tutorial. This is a Copyright Content.
|
|
|
|