首页  >  文章  >  后端开发  >  本地php虚拟环境如何修改session时间

本地php虚拟环境如何修改session时间

WBOY
WBOY原创
2016-06-13 13:27:12761浏览

本地php虚拟环境怎么修改session时间
本地php虚拟环境怎么修改session时间
我在本地安装了zencart网店系统,但用户登录时间实在太太短了,不一会就自动退出,请问本地php环境怎么修改session时间

------解决方案--------------------
php.ini
------解决方案--------------------
1463 ; Lifetime in seconds of cookie or, if 0, until browser is restarted.
1464 ; http://php.net/session.cookie-lifetime
1465 session.cookie_lifetime = 0

1483 ; Defines the probability that the 'garbage collection' process is started
1484 ; on every session initialization. The probability is calculated by using
1485 ; gc_probability/gc_divisor. Where session.gc_probability is the numerator
1486 ; and gc_divisor is the denominator in the equation. Setting this value to 1
1487 ; when the session.gc_divisor value is 100 will give you approximately a 1% chance
1488 ; the gc will run on any give request.
1489 ; Default Value: 1
1490 ; Development Value: 1
1491 ; Production Value: 1
1492 ; http://php.net/session.gc-probability
1493 session.gc_probability = 1
1494 
1495 ; Defines the probability that the 'garbage collection' process is started on every
1496 ; session initialization. The probability is calculated by using the following equation:
1497 ; gc_probability/gc_divisor. Where session.gc_probability is the numerator and
1498 ; session.gc_divisor is the denominator in the equation. Setting this value to 1
1499 ; when the session.gc_divisor value is 100 will give you approximately a 1% chance
1500 ; the gc will run on any give request. Increasing this value to 1000 will give you
1501 ; a 0.1% chance the gc will run on any give request. For high volume production servers,
1502 ; this is a more efficient approach.
1503 ; Default Value: 100
1504 ; Development Value: 1000
1505 ; Production Value: 1000
1506 ; http://php.net/session.gc-divisor
1507 session.gc_divisor = 1000
1508 
1509 ; After this number of seconds, stored data will be seen as 'garbage' and
1510 ; cleaned up by the garbage collection process.
1511 ; http://php.net/session.gc-maxlifetime
1512 session.gc_maxlifetime = 1440

看一下说明,都配合一起设置一下。

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn