Joshua LI
Joshua LI

Reputation: 4753

Session Data Lost after Redirection in PHP-FPM

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:

Any suggestions on how to troubleshoot this further would be appreciated.

Upvotes: 0

Views: 113

Answers (1)

Joshua LI
Joshua LI

Reputation: 4753

The problem was finally resolved by installing the SSL certificate and accessing the website via HTTPS.

Upvotes: 0

Related Questions