I am using cookies to store user preferences. When users log in I want to get their preferences from the database and store them in cookies. I want to store the cookie to expire on a fixed date like this:
document.cookie = document.getElementById('user').value + '=' + preferences + '; expires=Fri, 31-Dec-2030 23:59:59 GMT; path=/; domain=.website.com';
31-Dec-2030 23:59:59 GMT. How can I do the same in PHP?
setcookie("cookie_name", "cookie_value", strtotime('2030-31-12 23:59:59 GMT'));
setcookie("cookiename", 'cookievalue', strtotime('2030-31-12 23:59:59 GMT'));