The PHP setcookie() function is used to set the cookies.
bool setcookie ( string $name [, string $input = "" [, int $expire = 0 [, string $path = "" [, string $domain = "" [, bool $secure = false [, bool $httponly = false ]]]]]] )
|Sr.No||Parameters & Description|
It contains Name of the cookies.
It contains the port number.
It contains the information about cookies inputs.
It contains expire time information about cookies
It contains the information about cookies path wherein server.
It contains domain information.
<?php $input = 'It contains Name of the cookies'; setcookie("TestCookie", $input); setcookie("TestCookie", $input, time()+3600); setcookie("TestCookie", $input, time()+3600, "/~kennedy/", "webdesigntutorialz.com", 1); ?>
Do feel free to ask your questions where necessary and we will attend to them as soon as possible. If this tutorial was helpful to you, you can use the share button to share this tutorial.
Do follow us on our various social media handles available and also subscribe to our newsletter to get our tutorial posts delivered directly to your emails.
Thanks for reading and bye for now.