Sessions does not work when I change directory. I mean my files that contain codes for sessions run on the main directory. However, when I upload same files to different directory, they does not run. The same codes, files but not working in different directory. What is the problem? I confused.
Here is my codes:
<?php
ob_start();
session_start();
include("db.php");
$rota=strip_tags($_POST["rota"]);
$date=strip_tags($_POST["date"]);
$_SESSION['rota']=$rota;
$_SESSION['date']=$date;
?>
------
<?php session_start();
ob_start();
include("db.php");
$date=$_SESSION["date"];
$rota=$_SESSION["rota"];
echo "Date : <b>".$date."<br><br></b>";
?>
And here is my error log:
[12-Aug-2016 13:51:41 UTC] PHP Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/karelyac/public_html/reserve/en/y1s3.php:1) in /home/karelyac/public_html/reserve/en/y1s3.php on line 3
[12-Aug-2016 13:51:41 UTC] PHP Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/karelyac/public_html/reserve/en/y1s3.php:1) in /home/karelyac/public_html/reserve/en/y1s3.php on line 3
[12-Aug-2016 13:51:41 UTC] PHP Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/karelyac/public_html/reserve/en/db.php on line 7
[12-Aug-2016 13:51:43 UTC] PHP Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/karelyac/public_html/reserve/en/y1s2.php:1) in /home/karelyac/public_html/reserve/en/y1s2.php on line 3
[12-Aug-2016 13:51:43 UTC] PHP Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/karelyac/public_html/reserve/en/y1s2.php:1) in /home/karelyac/public_html/reserve/en/y1s2.php on line 3