Hi All,
I am trying to get to grips with PHP Sessions. I have a very simple
logon script that works fine so long as the client allows cookies.
However when they have cookes turned off (and I know some of them will
do) it dosnt work. I have 2 simple scripts below for testing that dont
work. I have tried various settings such as:
ini_set('sessio n.use_trans_sid ', false); AND
ini_set('sessio n.use_trans_sid ', true);
ini_set("sessio n.use_cookies", 0);
session_registe r("logged");
etc...
None seem to have any affect. The scripts I use for testing are below.
When run with cookies disabled the page2 comes up with the error
"Undefined index: logged .........". Am I being stupid here? Can
anyone point out what I am doing wrong?
----------------------------
page1.php
<?php
session_start() ;
session_set_coo kie_params(0);
$_SESSION['logged'] = 1;
echo $_SESSION['logged'];
?>
page2.php
<?php
session_start() ;
echo $_SESSION['logged'];
?>
---------------
Cheers,
Nick
I am trying to get to grips with PHP Sessions. I have a very simple
logon script that works fine so long as the client allows cookies.
However when they have cookes turned off (and I know some of them will
do) it dosnt work. I have 2 simple scripts below for testing that dont
work. I have tried various settings such as:
ini_set('sessio n.use_trans_sid ', false); AND
ini_set('sessio n.use_trans_sid ', true);
ini_set("sessio n.use_cookies", 0);
session_registe r("logged");
etc...
None seem to have any affect. The scripts I use for testing are below.
When run with cookies disabled the page2 comes up with the error
"Undefined index: logged .........". Am I being stupid here? Can
anyone point out what I am doing wrong?
----------------------------
page1.php
<?php
session_start() ;
session_set_coo kie_params(0);
$_SESSION['logged'] = 1;
echo $_SESSION['logged'];
?>
page2.php
<?php
session_start() ;
echo $_SESSION['logged'];
?>
---------------
Cheers,
Nick
Comment