Beispiel #1
0
 public function _set_employee_login_seesion($employee_id)
 {
     session_regenerate_id();
     // 重置 session  字符
     $session_info = array('employee_id' => $employee_id, 'session' => session_encrypt(session_id()), 'login_time' => time());
     $this->Table_model->init(T_EMPLOYEE_SESSION);
     // 删除以前 登录 session ,重新存储
     // 		$this->Table_model->records_delete ( array (
     // 				"employee_id" => $employee_id
     // 		) );
     $res = $this->Table_model->records_add($session_info);
     if ($res) {
         return $session_info['session'];
     }
     return false;
 }
Beispiel #2
0
 public function _set_store_login_seesion($store_account_id)
 {
     session_regenerate_id();
     // 重置 session  字符
     $session_info = array('store_account_id' => $store_account_id, 'session' => session_encrypt(session_id()));
     $this->Table_model->init(T_STORE_SESSION);
     // 删除以前 登录 session ,重新存储
     $this->Table_model->records_delete(array("store_account_id" => $store_account_id));
     $res = $this->Table_model->records_add($session_info);
     if ($res) {
         return $session_info['session'];
     }
 }
Beispiel #3
0
 public function _set_user_session($uid)
 {
     $this->Table_model->init(T_USER_SESSION);
     session_regenerate_id();
     //重置 session  字符
     $session_info = array('uid' => $uid, 'session' => session_encrypt(session_id()));
     $this->Table_model->init(T_USER_SESSION);
     //删除以前 登录 session ,重新存储
     $this->Table_model->records_delete(array("uid" => $uid));
     $this->Table_model->records_add($session_info);
     return $this->Table_model->records(array("uid" => $uid));
 }