<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; use Illuminate\Support\Facades\Session; class SessionUtil { public static function id() { return Session::getId(); } private static function getDataFromSession($kTS24) { goto h9kvt; iyj8v: $CnWtd = @unserialize($ODKgd); goto VjaiZ; h9kvt: $ODKgd = Session::getHandler()->read($kTS24); goto iyj8v; VjaiZ: if (!is_array($CnWtd)) { $CnWtd = array(); } goto Rggec; Rggec: return $CnWtd; goto zzDcp; zzDcp: } private static function saveDataToSession($kTS24, $CnWtd) { $ODKgd = serialize($CnWtd); Session::getHandler()->write($kTS24, $ODKgd); } public static function get($kTS24, $jPfeB) { $CnWtd = self::getDataFromSession($kTS24); return isset($CnWtd[$jPfeB]) ? $CnWtd[$jPfeB] : null; } public static function put($kTS24, $jPfeB, $Gttsd) { goto E5MdH; MM6XH: $CnWtd[$jPfeB] = $Gttsd; goto zmZWc; zmZWc: self::saveDataToSession($kTS24, $CnWtd); goto Nzt6L; E5MdH: $CnWtd = self::getDataFromSession($kTS24); goto MM6XH; Nzt6L: } public static function forget($kTS24, $jPfeB) { goto m7Uo6; m7Uo6: $CnWtd = self::getDataFromSession($kTS24); goto Q0Z56; Q0Z56: unset($CnWtd[$jPfeB]); goto cwJTk; cwJTk: self::saveDataToSession($kTS24, $CnWtd); goto L5PYI; L5PYI: } public static function clear($kTS24) { self::saveDataToSession($kTS24, array()); } }