[8] ErrorException in Index.php line 199

Trying to access array offset on value of type null

  1. }
  2. public function logout() {
  3. session('i_user', null);
  4. // session_destroy();
  5. $this->success('退出登录成功!', '@login');
  6. }
  7. public function personal() {
  8. if (!Session::get('i_user')['id']) {
  9. $this->redirect('@login');
  10. }
  11. $id = Session::get('i_user')['id'];
  12. if ($this->request->isPost()) {
  13. $post = $this->request->post();
  14. $user = Db::name('member')->where('id', $id)->find();
  15. if ($post['confirm_password'] != $post['password']) {
  16. $this->error('两次密码不正确');
  17. }

Call Stack

  1. in Index.php line 199
  2. at Error::appError() in Index.php line 199
  3. at Index->personal()
  4. at ReflectionMethod->invokeArgs() in App.php line 343
  5. at App::invokeMethod() in App.php line 611
  6. at App::module() in App.php line 456
  7. at App::exec() in App.php line 139
  8. at App::run() in start.php line 19
  9. at require('/var/www/html/odb/th...') in index.php line 20

Environment Variables

GET Data
empty
POST Data
empty
Files
empty

Cookies

sbda7c1a0
l833ud6jn5socdp4rjm6nue7mm
rows
15
Session
empty

Server/Request Data

REDIRECT_UNIQUE_ID
Zlql8-ucl00JV0uaA3Xl2wAAANQ
REDIRECT_STATUS
200
UNIQUE_ID
Zlql8-ucl00JV0uaA3Xl2wAAANQ
HTTP_HOST
ogb.shec.edu.cn
HTTP_USER_AGENT
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.93 Safari/537.36
HTTP_ACCEPT
*/*
HTTP_ACCEPT_ENCODING
gzip, deflate
HTTP_ACCEPT_LANGUAGE
zh-CN,zh;q=0.9,en;q=0.8
HTTP_COOKIE
sbda7c1a0=l833ud6jn5socdp4rjm6nue7mm; rows=15
HTTP_REFERER
/login/index/personal.html
HTTP_X_FORWARDED_BY
:443
HTTP_X_FORWARDED_FOR
117.183.149.244, 103.45.128.30
HTTP_X_FORWARDED_HOST
ogb.shec.edu.cn
HTTP_X_FORWARDED_PROTO
https
HTTP_X_REAL_IP
117.183.149.244
PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
SERVER_SIGNATURE
SERVER_SOFTWARE
Apache/2.4.55 (codeit) PHP/7.4.33
SERVER_NAME
ogb.shec.edu.cn
SERVER_ADDR
172.19.68.2
SERVER_PORT
80
REMOTE_ADDR
172.19.68.76
DOCUMENT_ROOT
/var/www/html/odb
REQUEST_SCHEME
http
CONTEXT_PREFIX
CONTEXT_DOCUMENT_ROOT
/var/www/html/odb
SERVER_ADMIN
root@localhost
SCRIPT_FILENAME
/var/www/html/odb/index.php
REMOTE_PORT
54049
REDIRECT_URL
/login/index/personal.html
REDIRECT_QUERY_STRING
s=login/index/personal.html
GATEWAY_INTERFACE
CGI/1.1
SERVER_PROTOCOL
HTTP/1.1
REQUEST_METHOD
GET
QUERY_STRING
s=login/index/personal.html
REQUEST_URI
/login/index/personal.html
SCRIPT_NAME
/index.php
PHP_SELF
/index.php
REQUEST_TIME_FLOAT
1717216755.5448
REQUEST_TIME
1717216755
PATH_INFO
login/index/personal.html
Environment Variables
empty

ThinkPHP Constants

APP_PATH
/var/www/html/odb/application/
RUNTIME_PATH
/var/www/html/odb/runtime/
THINK_VERSION
5.0.24
THINK_START_TIME
1717216755.5455
THINK_START_MEM
361416
EXT
.php
DS
/
THINK_PATH
/var/www/html/odb/thinkphp/
LIB_PATH
/var/www/html/odb/thinkphp/library/
CORE_PATH
/var/www/html/odb/thinkphp/library/think/
TRAIT_PATH
/var/www/html/odb/thinkphp/library/traits/
ROOT_PATH
/var/www/html/odb/
EXTEND_PATH
/var/www/html/odb/extend/
VENDOR_PATH
/var/www/html/odb/vendor/
LOG_PATH
/var/www/html/odb/runtime/log/
CACHE_PATH
/var/www/html/odb/runtime/cache/
TEMP_PATH
/var/www/html/odb/runtime/temp/
CONF_PATH
/var/www/html/odb/application/
CONF_EXT
.php
ENV_PREFIX
PHP_
IS_CLI
false
IS_WIN
false
QINIU_FUNCTIONS_VERSION
7.2.1