<?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($lX_0f) { goto GqUeF; U4mY0: return $Sj05q; goto rAB0z; c_Su7: $Sj05q = @unserialize($INg34); goto tM3vw; tM3vw: if (!is_array($Sj05q)) { $Sj05q = array(); } goto U4mY0; GqUeF: $INg34 = Session::getHandler()->read($lX_0f); goto c_Su7; rAB0z: } private static function saveDataToSession($lX_0f, $Sj05q) { $INg34 = serialize($Sj05q); Session::getHandler()->write($lX_0f, $INg34); } public static function get($lX_0f, $HQKqq) { $Sj05q = self::getDataFromSession($lX_0f); return isset($Sj05q[$HQKqq]) ? $Sj05q[$HQKqq] : null; } public static function put($lX_0f, $HQKqq, $mdHu1) { goto O9lDf; O9lDf: $Sj05q = self::getDataFromSession($lX_0f); goto CKsho; dNUKm: self::saveDataToSession($lX_0f, $Sj05q); goto EB2Tc; CKsho: $Sj05q[$HQKqq] = $mdHu1; goto dNUKm; EB2Tc: } public static function forget($lX_0f, $HQKqq) { goto Fxjy0; gH34B: self::saveDataToSession($lX_0f, $Sj05q); goto GS1wN; Fxjy0: $Sj05q = self::getDataFromSession($lX_0f); goto pZR05; pZR05: unset($Sj05q[$HQKqq]); goto gH34B; GS1wN: } public static function clear($lX_0f) { self::saveDataToSession($lX_0f, array()); } }