Php Session expires after change page
Hi ,i have 2 simple pages for test sessions in php
first page :
='world';?>
second page:
;?>
Notice: Undefined variable: _SESSION in /home/itmediaquality/public_html/testsession2.php on line 5
Note: i don't have any problem in local test environment ! i need to config something on cPanel or php.ini ? thanks
adding session_start on second page i got:
Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/itmediaquality/public_html/testsession2.php:2) in/home/itmediaquality/public_html/testsession2.php on line 5
world
-
You have not specified session_start();
in your second page which is why it is not set. Also, session_start() must be specified before any text is outputted to the system. It's always best to start your page with0
Please sign in to leave a comment.
Comments
2 comments