codeIgniter默认情况下关闭浏览器不会使session过期

codeIgniter默认情况下关闭浏览器不会使session过期。也就是说,如果你没有显式登出而只是关闭浏览器,在一定时间内(codeIgniter默认是2小时)打开浏览器重新访问这个网站,会发现你仍处于登录状态。

为了规避这个风险,应该

//config.php
$config['sess_expire_on_close'] = TRUE;

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.