为了提高性能,我将问题更改session.save_handler
为memcache
$_sessions 不起作用。
在php中
session_start();
$_SESSION['admin_referrer'] = $_SERVER['REQUEST_URI'];
... different page
session_start();
echo $_SESSION['admin_referrer']
如果我将 session.save_handler 改回文件,上面的代码可以正常工作。
php.ini
session.save_handler = memcache
session.save_path = "tcp://localhost:11211?persistent=1&weight=1&timeout=1&retry_interval=15"
我可以确认phpinfo();
memcache 已加载。
echo "stats settings" | nc localhost 11211
STAT maxbytes 947912704
STAT maxconns 10240
STAT tcpport 11211
STAT udpport 11211
STAT inter NULL
STAT verbosity 0
STAT oldest 2255393
STAT evictions on
STAT domain_socket NULL
STAT umask 700
STAT growth_factor 1.25
STAT chunk_size 48
STAT num_threads 4
STAT stat_key_prefix :
STAT detail_enabled no
STAT reqs_per_event 20
STAT cas_enabled yes
STAT tcp_backlog 1024
STAT binding_protocol auto-negotiate
STAT auth_enabled_sasl no
STAT item_size_max 1048576
END