Re: session destroy ??
| From: | Chris Lee | Date: | Wed, 19 Dec 2001 22:12:08 +0000 |
| Subject: | Re: session destroy ?? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-78249@lists.php.net to get a copy of this message | ||
<?php
session_start();
// destroy the session
session_destroy();
$p = session_get_cookie_params();
// destory the cookie
setcookie(session_name(), '' , 0, $p['path'], $p['domain']);
// redirect without the SID for trans-sid users
header("Location: http://$SERVER_NAME");
?>
works for me. yes its stupid, but a session has to be started beore it can
be destroyed.
--
Chris Lee
lee@mediawaveonline.com
"Olivier Masudi" <olivier@clickway.be> wrote in message
news:NFBBIBOOOLLPDLDCDJMMEEDGCDAA.olivier@clickway.be...
> In my online store i use session.
>
> I use a script to check that a user dont make 2 order during the same
> session using the back button for that i put his sessionid in the db and
> check it before processing the order.
>
> My probleme is how can i give a new session_id to the person when he goes
> back to the home page of my site so he can do a new order ?
>
> I try session_destroy , session_unset
> but the person have still the same session_id
>
> REMARK
>
> I always use the same string into session_name("abcdef") for all the user.
> Is it a problem?
>
>
> Thanks for your help
>