首頁  >  文章  >  後端開發  >  本地php虚拟环境如何修改session时间

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

WBOY
WBOY原創
2016-06-13 13:27:12771瀏覽

本地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