When one page is accessed, I would like to start a session and store a session variable:
<?php
session_start();
$_SESSION['myvar']='myvalue';
?>
Then from another page, I would like to check if that session variable has been stored:
<?php
session_start();
echo("1");
if(isset($_SESSION['myvar']))
{
echo("2");
if($_SESSION['myvar'] == 'myvalue')
{
echo("3");
exit;
}
}
?>
This code does not work for me.
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…