mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-04 14:22:48 +08:00
改进Session类的flush方法 判断是否开启session
This commit is contained in:
@@ -217,14 +217,16 @@ class Session
|
|||||||
*/
|
*/
|
||||||
public static function flush()
|
public static function flush()
|
||||||
{
|
{
|
||||||
$item = self::get('__flash__');
|
if (self::$init) {
|
||||||
|
$item = self::get('__flash__');
|
||||||
|
|
||||||
if (!empty($item)) {
|
if (!empty($item)) {
|
||||||
$time = $item['__time__'];
|
$time = $item['__time__'];
|
||||||
if ($_SERVER['REQUEST_TIME_FLOAT'] > $time) {
|
if ($_SERVER['REQUEST_TIME_FLOAT'] > $time) {
|
||||||
unset($item['__time__']);
|
unset($item['__time__']);
|
||||||
self::delete($item);
|
self::delete($item);
|
||||||
self::set('__flash__', []);
|
self::set('__flash__', []);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user