T
T
tuxx2017-06-19 11:03:18
PHP
tuxx, 2017-06-19 11:03:18

Lost php session in Firefox Android?

Only Firefox on Android gets an empty session. In any other browsers (and desktop Firefox) sessions work correctly.
The session starts at the very beginning and looks like this:

session_start();
session_set_cookie_params(2592000, '/', '.' . $_SERVER['HTTP_HOST']);
setcookie('PHPSESSID', session_id(), time() + 2592000, '/', '.' . $_SERVER['HTTP_HOST']);
session_regenerate_id(true);

The cookie has a PHPSESSID.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
tuxx, 2017-06-21
@tuxx

Problem solved. I should have read the documentation for more details. The problem was session_regenerate_id. It says:
After disconnection, sessions work correctly everywhere, but this lowers security.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question