Answer the question
In order to leave comments, you need to log in
Cross-domain COOKIES installation via PHP on NGINX. Where to dig?
I recently started working on NGINX servers - I dig to the best of my knowledge ...
There are two domains domain1.mysite.com and domain2.mysite.com
On the domain1.mysite.com domain I set COOKIE:
setcookie( 'cookie' , 'hi' , time()+3600 , '/' , '.mysite.com' , false , true);
server {
listen 80 default_server;
server_name www.mysite.com;
charset utf8;
...
location / {
root /home/www;
index index.php;
if (!-e $request_filename) {
rewrite ^/(.+)$ /index.php?uri=$1 last;
break;
}
location ~ \.php$ {
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_script_name;
#
fastcgi_connect_timeout 3000;
fastcgi_send_timeout 3000;
fastcgi_read_timeout 3000;
fastcgi_buffer_size 128k;
fastcgi_buffers 4 256k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
fastcgi_intercept_errors on;
include fastcgi_params;
client_max_body_size 10m;
client_body_buffer_size 128k;
expires off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
fastcgi_pass unix:/var/run/php5-fpm.sock;
}
}
#error_page 404 /404.php;
error_page 500 502 503 504 /50x.php;
location = /50x.html {
root /home/www;
}
}
Answer the question
In order to leave comments, you need to log in
Well, actually, the behavior of cookies should not change from the name of the server.
Look in the browser what and how it is put, and how it differs from what you are trying to put, you need to dance from this.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question