why my session lost in other pages? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=11) +--- Thread: why my session lost in other pages? (/showthread.php?tid=69373) |
why my session lost in other pages? - h_qorbani - 11-11-2017 Hi it's first time that I use Codeigniter. after authentication for login I set session in Login_model.php: PHP Code: $data_session = array( PHP Code: print_r($this->session->userdata()); Code: Array Code: Array my current setting: config.php PHP Code: $config['sess_driver'] = 'files'; PHP Code: $autoload['libraries'] = array('database','template','session','encryption','form_validation'); RE: why my session lost in other pages? - Narf - 11-11-2017 (11-11-2017, 02:29 AM)h_qorbani Wrote: This is a full URL, not a domain name. If you want the session to only be available on that URL, do this: PHP Code: $config['cookie_domain'] = 'domain.com'; (where of course 'domain.com' is just an example and I hope you meant that as well) However, with you autoloading the session library, it will still create sessions on other paths and you'll have the same issue if you try to use them. |