I try to create a session to be available for PHP pages.
But it is not working.
Test1.php
session_start();
$_SESSION["current_id"] = 7 ;
echo "Current id : " . $_SESSION['current_id'] . "</br>" ;
if (!is_writable(session_save_path())) {
echo 'Session path "' . session_save_path() . '" is not writable for PHP!'; }
else {
echo 'Session path "' . session_save_path() . '" is Writable for PHP!'; }
echo("</br>");
var_dump($_SESSION);
Result:
Current id : 7
Session path "/var/lib/php5" is Writable for PHP! /home/ubuntu/workspace/CRF/main1.php:58: array(1) { 'current_id' => string(1) "7" }
Tets2.php
session_start();
echo "Current id : " . $_SESSION['current_id'] . "</br>" ;
echo("</br>");
var_dump($_SESSION);
Result:
Current id : /home/ubuntu/workspace/CRF/workflow.php:108: array(0) { }
Any Ideas?