php - Cookies not expiring on all pages -
i'm working on little log in syetms website, hwoever have hit little snag. i'm using cookies track users logged in. i'm trying make pages restricted vistors have logged in only, decided use if($_cookie["loggedin"] == true){
works log in page when logout using setcookie("loggedin", null, time() - 60000);
other pages apart log in page retain value true, username value remains set on teh other pages no log in page. set cookie setcookie("loggedin", true, time() + 3600);
. i'm still new php appreciated
for logging in , consistency between pages. might better put session_start()
@ top of pages , use $_session
instead of $_cookie
.
Comments
Post a Comment