[英]CodeIgniter sessions won't stick on localhost (MAMP)
It appears that my CI_Sessions
or even normal php sessions
won't stick on my localhost .看来我的
CI_Sessions
甚至normal php sessions
不会粘在我的localhost上。 I'm running MAMP .我正在运行MAMP 。
What am I doing wrong?我究竟做错了什么?
I pulled a site from our live environment and had the same problem.我从我们的生活环境中提取了一个网站并遇到了同样的问题。 I had to clear the $config['cookie_domain'] value in config.php
我必须清除 config.php 中的 $config['cookie_domain'] 值
$config['cookie_domain'] = "";
Make sure your MAMP/tmp/php
folder has the right permissions set to it -- most likely it does not.确保您的
MAMP/tmp/php
文件夹设置了正确的权限——很可能没有。
Another cause for strange session behavior is white space after you close your PHP tag IE:奇怪的 session 行为的另一个原因是关闭 PHP 标签 IE 后的空白:
<?php
session_start();
$_SESSION['test'] = 'this is a test';
?>
[line breaks/spaces]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.