I have set up an Oracle Linux server with Apache httpd and PHP 8.3.12 (running as PHP-FPM). However, the $_SESSION["user"] variable returns null after a page redirection.
The PHP application was previously running successfully on an older CentOS server as well as using XAMPP under Windows desktop environments.
This problem causes my application not able to login users in.
Does anyone know how I can resolve this issue of losing session data after redirection when using PHP-FPM on Oracle Linux?
The session path is set to 0;777; in the /etc/php-fpm.d/www.conf file:
php_value[session.save_path] = "0;777;/var/lib/php/session"
Some things I have checked:
- The session save path and permissions are correct
session.save_handleris set to"files"- Restarting PHP-FPM and httpd did not fix the problem.
- I deleted all the files in the
session.save_path, and upon logging into the application, new session files were generated in thesession.save_path.
Any suggestions on how to troubleshoot this further would be appreciated.
https://example-a.com/login.phptohttps://example-b.com/loggedin.php? Can you add the redirection code in your question?http://example.com/logintohttp://example.com/after authentication checking.