I see some frameworks, CMS and the like, write cookies directly in PHP with setcookie
and others stock to emit in headers
at the end of execution. I would like to know how to create a pattern for creating cookies.
PHP
The setcookie () function sets a cookie to be sent along with the rest of the HTTP headers
Should we create by sending by header?
header( "Set-Cookie: {$name}={$value};" )
Or is it PHP?
setcookie( $name , $value )