I want to set a cookie that expires in 90 days using PHP, how can I do this? Thanks in advance.
setcookie(name, value, time()+60*60*24*90);
This will set the cookie for 90 days.
Cookies expire in seconds: 60 * 60 * 24 * 90 - 90 days.
setcookie("MyCookie", $value, time()+(60*60*24*90));
Use this:
setcookie('name', 'value', strtotime('NOW+90DAYS'));
setcookie('cookie_name', 'cookie_value', time() + 7776000);
Check out the documentation for more details - http://php.net/manual/en/function.setcookie.php
setcookie("TestCookie", $value, time()+7776000);
Source: https://habr.com/ru/post/1773959/More articles:How to request index metadata in PostgreSQL - postgresqlстол, табличный, табличный, вертикальный, латекс - alignmentJSP Web Design Tool - jspAnt: how can I perform tasks on several projects - java-moz-inline-box vs -moz-inline-stack - cssHow do java generic methods limit method type arguments? - javato bind HTTServer to local ip: port so that others on the local network can see it? - pythonSetting DisplayMemberPath to Membership in a Dictionary Structure - wpfwin32 virtual folder api - winapiDevelopment - Flash notifications - ruby-on-railsAll Articles