简体   繁体   中英

codeigniter fatal error Call to a member function cookie() on a non-object

i have Codeigniter v202, and php version 5.2.17 my site works just good in my local but in the server i keep getting this error message in everypage, message in error log is:

PHP Fatal error: Call to a member function cookie() on a non-object in /path/to/libraries/Session.php on line 138

and in page i have

A PHP Error was encountered

Severity: Notice

Message: Undefined property: MY_CONTROLLER_NAME::$input

Filename: libraries/Session.php

Line Number: 138

this is line 138:

$session = $this->CI->input->cookie($this->sess_cookie_name);

library is the original, i didnt make any changes on it. please help!

I found what was wrong. i had

setlocale(LC_ALL, 'tr_TR');

in my /index.php . so weird but session library did not initialize core input . it took me long to find but when i echo

echo var_dump($this->CI);

there was ? (question mark) instead of the char I then it was ?nput . my locale didn't capitalize char i as I , that was the problem. weird thing is it worked in localhost but didn't work on the server.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM