Why isnt php reading my cookie?
Posted
by Jason94
on Stack Overflow
See other posts from Stack Overflow
or by Jason94
Published on 2010-05-12T09:20:18Z
Indexed on
2010/05/12
9:24 UTC
Read the original article
Hit count: 281
at index.php i have a form to fill out some settings. the form posts to setsettings.php
at setsettings.php it uses the form data and sets some cookies and redirect back to index.php. if i print_r($_COOKIE) at setsettings.php all is well. but nothing comes up at index.php, the $_COOKIE array is empty :(
Does somebody know how i go about solving this?
I set det setting by (setsettings.php):
/* Write new cookie */
$expire = 60 * 60 * 24 * 60 + time(); // ~2 months
setcookie("user_var_001", $_POST['selection'], $expire);
and in index.php print_r($_COOKIE) turns up blank;
© Stack Overflow or respective owner