0

I have installed a XAMPP server on my MAC laptop.I am able to access my php files from an HTML request on my Laptop and $_SESSION is working if i use http://localhost.Things work as expected by persisting session information across php files. My other friend who is on my LAN network tried to connect to my XAMPP server php files using the same HTML files in his laptop.When ever he sends request $_SESSION[] is not working and am not getting data persisted across pages.HY other friend has enabled cookies on his browser too.He is using Safari too to connect.

Could you please tell what could be the issue?.

4

1 回答 1

0

当你创建一个会话时,你必须给它一个可以工作的域。如果您使用localhost作为域或127.0.0.1创建会话,而当您的朋友从 LAN 中的另一台计算机连接时,它将根本无法工作。尝试使用您的 LAN IP 地址来创建 cookie

于 2012-05-30T21:51:09.463 回答