Quantcast
Channel: Nginx Forum
Viewing all articles
Browse latest Browse all 53287

PHP Sessions not "saving" / "working"

$
0
0
Hi all,

I am running nginx and php-fpm on Centos 6.3.

I am noticing a strange behaviour where php sessions are not working. To troubleshoot it, I did the basics:

1. Made sure php-fpm was using the /tmp directory
2. chmod 777 /tmp
3. Set php-fpm to use the same user as nginx.

None of this helped, so then I created a simple PHP file to help diagnose: sessiontest.php

<?php
session_start();
$_SESSION["count"]++;
print_r($_SESSION);
echo session_id();
?>

When I run this file, in theory, the value should increase by 1 every single time. However, it does not.

Does anybody have any suggestions?

Viewing all articles
Browse latest Browse all 53287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>