Re: Sessions
From: Pedro Graca (hexkid_at_hotpop.com)
Date: 11/08/03
- Next message: Rafal 'Raf256' Maj: "Passthru"
- Previous message: Dan Walker: "Re: Sessions"
- In reply to: Dan Walker: "Sessions"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 8 Nov 2003 18:40:13 GMT
Dan Walker wrote:
> Please can someone provide a nice simple script to test if my php is setup
> properly for sessions. Just a little 2 page thing to prove that it is me
> that is the problem would be excellent. Thanks.
I use this:
<?php
session_start();
if (isset($_GET['reset'])) {
unset($_SESSION['counter']);
session_unset();
session_destroy();
session_start();
$_SESSION['counter'] = 0;
}
if (!isset($_SESSION['counter'])) {
$_SESSION['counter'] = 0;
}
echo 'SID = ', session_id(), '<br/>counter: ',
$_SESSION['counter'], '<br/>';
echo 'add one -- <a ',
'href="', $_SERVER['PHP_SELF'], '?reset">reset</a>';
++$_SESSION['counter'];
?>
But I don't know why session_id doesn't change at every reset :o
-- .sig
- Next message: Rafal 'Raf256' Maj: "Passthru"
- Previous message: Dan Walker: "Re: Sessions"
- In reply to: Dan Walker: "Sessions"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|