I use, Apache/2.4.28 (Win64) PHP/7.0.32 in a Windows environment.
I try to do with this question, but in my case, a lost error occurs sometimes.
(Sometimes mean, problem occur 5 hours or more hours or few days...)
(I think, maybe.. this PHP problem https://bugs.php.net/bug.php?id=16263)
(This, very similar case, but don't have solution... https://serverfault.com/questions/869781/apache-on-windows-cookie-w-php-sessions-bug)
When I try to save session and redirect, sometimes it fail.
//Normal case
session_start() -> get session id from server 'aaa' -> save in cookie
redirect with 'aaa' cookie in request header
I can use session in redirect page.
//Error case
session_start() -> get session id from server 'aaa' -> save in cookie
redirect with 'aaa' cookie in request header
but server response different session id 'bbb'. Even web-server has 'sess_aaa' file on Windows temp folder. In this case, server has 'sess_aaa' and 'sess_bbb' two session files.
- sess_aaa : have session information.
- sess_bbb : 0kb empty session file
I can not use session until apache restart.
//More information about this error...
- Windows resource CPU 3~5%, Memory 30% -> no problem
- $_GET, $_POST, $_REQUEST, $_SERVER other PHP variables works well.
Please help me with your good idea.(Thanks for Hastur's guide)