I am trying to set using:
<?php
session_start();
print_r($_SESSION);
$_SESSION['test'][] = time();
// header('Content-type: text/plain');
print_r($_SESSION);
Now, on running first time, I get:
Array
(
)
Array
(
[test] => Array
(
[0] => 1493663090
)
)
On running second time, I got the same output. It means the session array gets empty, everytime I run my script. Why is it so?