protected function check_cookie() { $user_id = Util_Server_Request::get_cookie('userid'); $user_name = Util_Server_Request::get_cookie('username'); $user_role = Util_Server_Request::get_cookie('userrole'); $time = Util_Server_Request::get_cookie('time'); $secstr = Util_Server_Request::get_cookie('secstr'); $seckey = lb_read_system('seckey'); return $secstr === md5($user_id . '$' . $user_name . '$' . $user_role . '$' . $time . '$' . $seckey); }
public function get_cookie($file = '') { $saved_file = Util_Server_Request::get_cookie('cookiefile'); if ($saved_file) { $file = $saved_file; } else { $file = $file ? $file : 'local-' . microtime(); Util_Client_Cookie::set_cookie('cookiefile', $file, time() + 90 * 24 * 3600); } return APP_PATH . '/tmp/cookie/' . $file; }