Hi all.
I am having a weird problem with PHP sessions. I create a session but when I click a link inside my site, other session is created. To test it I copy this code below and tried to run in same environment (WAMP at localhost). The same behavior was presented. Sometimes, clicking at that link works, but almost every time a new session is created.
What do you suggest me to do, to solve this?
Thank you very much.
<?php
session_start();
if (!isset($_SESSION['test'])) {
echo "First activation: setting session variable";
$_SESSION['test'] = 1;
} else {
echo "SESSIONS ARE WORKING! activation: ", (++$_SESSION['test']);
?>
<br><a href="http://localhost:8081/testesession.php">Again</a>
<?php
}
echo "<br>" . session_id();
?>