I have a session formed the following way:
function sec_session_start() {
$session_name = 'primary_session';
$secure = false;
$httponly = true;
if (ini_set('session.use_only_cookies', 1) === FALSE) {
header("Location: /error?e=1");
exit();
}
$cookieParams = session_get_cookie_params();
session_set_cookie_params(3600,$cookieParams["path"],$cookieParams["domain"],$secure,$httponly);
session_name($session_name);
session_start();
session_regenerate_id(true);
}
I use this on all my page by adding
sec_session_start();
on my index page, which requires correct files depending on what page I am accessing.
It works perfectly fine with slow navigation.
However, when rapid navigational clicks occur, for some reason it unchecked, and the user is logged out. How come?
This is the button I press rapidly. NOTE: It also changes the page from www.example.com
to www.example.com/users
, and then just repeats www.example.com/users
until session is broken.
And this is the result after about, 2-3 rapid clicks. Works fine when pressed 1-2 times a second, max.
I have tried not using it as a function, and putting it on the absolutt TOP of the page without success.