Tell me the solution to the problem - Architecture: nginx -> apache

I authorize via ajax to the login.php script, after successful authorization, the login.php script should set up cookies and sessions, but they are not set, there are no errors in the nginx and apache logs. In cookies I prescribe a domain and path.

Конфиг nginx # Перенаправление на back-end location / { proxy_pass http://192.168.10.80:8080/www2/public/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; proxy_connect_timeout 120; proxy_send_timeout 120; proxy_read_timeout 180; } 

I use Codeigniter framework, login.php code

  $this->CI->input->set_cookie(array( 'name' => 'auth', 'value' => $data, 'expire' => $ttl )); $newdata = array( 'name' => 'auth', 'value' => $data, 'logged_in' => TRUE ); $this->CI->session->set_userdata($newdata); 
  • Not enough information. The first thing that comes to mind is headers already sent; cookies must be set before any output. Secondly, php errors are not always written to the server log, try using pens to open your login.php and see how it behaves. - Darth
  • one
    This is how to call the traumatologist on the background of the body, describe the fracture and ask him to cast a plaster remotely. At least attach something, at least some code fragments. - mccrush
  • [ tsya.ru] [] - etki
  • I will assume. My "favorite" error, forget to enter the line session_start (); Have you forgotten about her? - Pavel Vershinin

1 answer 1

Responses from comments:


The first thing that comes to mind is headers already sent; cookies must be set before any output. Secondly, php errors are not always written to the server log, try using pens to open your login.php and see how it behaves. - darth


I will assume. My "favorite" error, forget to enter the line session_start (); Have you forgotten about her? - Pavel Vershinin