php - Undefined index while fetching the cookie value after closing browser -


i trying implement remember me feature. working whenever close browser cookie deleted , showing error: undefined index

my code setting cookie is: setcookie("rememberme", $cookie);

the file set cookie , file fetching in same location.

checked in more 1 browser same problem

unless specify when cookie expire automatically expire when browser window closed. third parameter of setcookie() allows specify expiration of cookie:

// cookie expires in 1 year setcookie("rememberme", $cookie, strtotime('+1 year')); 

Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -