<?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($DL6hH) { goto SIw41; KJpvO: return $zonFp; goto jYAzg; SIw41: $jgwc0 = Session::getHandler()->read($DL6hH); goto QrTJV; UUIjQ: if (!is_array($zonFp)) { $zonFp = array(); } goto KJpvO; QrTJV: $zonFp = @unserialize($jgwc0); goto UUIjQ; jYAzg: } private static function saveDataToSession($DL6hH, $zonFp) { $jgwc0 = serialize($zonFp); Session::getHandler()->write($DL6hH, $jgwc0); } public static function get($DL6hH, $VFU9l) { $zonFp = self::getDataFromSession($DL6hH); return isset($zonFp[$VFU9l]) ? $zonFp[$VFU9l] : null; } public static function put($DL6hH, $VFU9l, $HDpl6) { goto Qzzm0; ViJl7: self::saveDataToSession($DL6hH, $zonFp); goto fuvOd; JFKdy: $zonFp[$VFU9l] = $HDpl6; goto ViJl7; Qzzm0: $zonFp = self::getDataFromSession($DL6hH); goto JFKdy; fuvOd: } public static function forget($DL6hH, $VFU9l) { goto zrSMq; DgvkL: unset($zonFp[$VFU9l]); goto NWyZo; zrSMq: $zonFp = self::getDataFromSession($DL6hH); goto DgvkL; NWyZo: self::saveDataToSession($DL6hH, $zonFp); goto dG0Qi; dG0Qi: } public static function clear($DL6hH) { self::saveDataToSession($DL6hH, array()); } }