Nginx with php-fpm session not working

6,375

I found my solution.

looks like the permission error was in the cookie folder "session.cookie_path" So.. the session folder is ok.. but since cookie was not ok, it didnt know the user session and created a new one all the time.

Share:
6,375

Related videos on Youtube

Henrique Kieckbusch
Author by

Henrique Kieckbusch

Updated on September 18, 2022

Comments

  • Henrique Kieckbusch
    Henrique Kieckbusch almost 2 years

    My php session is to:

    session.save_path = /var/lib/php/session
    

    If i make a simple script to test like:

     session_start(); 
     $_SESSION['hi'] = 1; 
     var_dump($_SESSION);
    

    Well the session is not working.

    When I list the folder: "/var/lib/php/session" I see it is creating a new file everytime. So If I reload the page 1000 I will have 1000 session files.. Its losing the session and creating a new one.

    So its has the permission to write to the file, but for some reason it is always creating a new session.