static function redirect($uri = null, $withInput = false, $flashData = []) { Session::reflash(); if ($withInput) { Input::flash(); } foreach ($flashData as $k => $v) { Session::flash($k, $v); } if (!$uri) { $uri = Request::referer(); } header('location: ' . $uri); return '<p>This page is moved to <a href="' . $uri . '">' . $uri . '</a></p>'; }
static function logout() { Session::forget('auth'); }
function session($k, $default = '') { if (is_array($k)) { foreach ($k as $sk => $sv) { \Boofw\Phpole\Http\Session::put($sk, $sv); } return null; } return \Boofw\Phpole\Http\Session::get($k, $default); }
static function old($k) { return Session::get('_old_input.' . $k, ''); }