|
本帖最后由 雨夜漫步 于 2017-5-5 16:37 编辑
在config中设置如下
$config['sess_driver'] = 'files';
$config['sess_cookie_name'] = 'ci_session';
$config['sess_expiration'] = 7200;
$config['sess_save_path'] = NULL;
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 0;
$config['sess_regenerate_destroy'] = FALSE;
服务器lnmp环境下responsesheader主要参数如下
Cache-Control:no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Connection:keep-alive
Content-Encoding:gzip
Content-Type:text/html; charset=UTF-8
Date:Fri, 05 May 2017 08:18:37 GMT
Expires:Thu, 19 Nov 1981 08:52:00 GMT
Pragma:no-cache
Server:nginx
Transfer-Encoding:chunked
Vary:Accept-Encoding
X-Powered-ByHP/5.5.36
requestheader如下:
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Encoding:gzip, deflate, sdch
Accept-Language:zh-CN,zh;q=0.8
Cache-Control:no-cache
Connection:keep-alive
Cookie:PHPSESSID=gpuhsmet31q30ijqv4shnqh6b2
Host:test.pingze.com
Pragma:no-cache
Referer: url
Upgrade-Insecure-Requests:1
User-Agent:Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1
本地wamp环境下responseheader如下:
Cache-Control:no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Connection:Keep-Alive
Content-Type:text/html; charset=UTF-8
Date:Fri, 05 May 2017 08:13:14 GMT
Expires:Thu, 19 Nov 1981 08:52:00 GMT
Keep-Alive:timeout=5, max=100
Pragma:no-cache
Server:Apache/2.2.21 (Win32) PHP/5.3.10
Set-Cookie:ci_session=c003kbb0mhkt3nmdqb4uth71rmk5tpfu; expires=Fri, 05-May-2017 10:13:14 GMT; path=/; httponly
Transfer-Encoding:chunked
X-Powered-ByHP/5.3.10
requestheaders:
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Encoding:gzip, deflate, sdch
Accept-Language:zh-CN,zh;q=0.8
Cache-Control:no-cache
Connection:keep-alive
Cookie:ci_session=c003kbb0mhkt3nmdqb4uth71rmk5tpfu
Host:
Pragma:no-cache
Referer:url
Upgrade-Insecure-Requests:1
User-Agent:Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1
可以很明显的看出本地wamp环境下 cookie 的名字和设置里是一致的 服务器上保留了 php.ini 配置的默认命名
另外本地每次请求都会setcookie 服务器端则不会 之前尝试了更改路径的设置 也是在本地wamp下生效 服务端依旧和php 默认配置一致
求大神帮忙
|
|