session lifetime: does not work
| From: | Samuel Luescher | Date: | Wed, 29 Nov 2000 21:26:55 +0000 |
| Subject: | session lifetime: does not work | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-27886@lists.php.net to get a copy of this message | ||
have i got something wrong here? i am trying to
create a site that lets the user choose if he
wants his data "remembered" or not.
however, i set the cookie lifetime to zero
and whenever i close the browser, the variables
are still there the next time i access the site.
(yes: i clicked "reload".)
--8<--------------------------------------------------------
if ($remember_user)
$exp = time()+$session_expiretime;
else $exp = 0;
session_start();
session_set_cookie_params($exp);
session_register("session_username");
session_register("session_password");
// just to make sure the lifetime is really 0 after that.
// which it is.
$p = session_get_cookie_params();
echo $p["lifetime"];
--8<--------------------------------------------------------
(running apache/php 4/debian)
can anybody say something bout that? tia!