Welcome Guest, Not a member yet? Register   Sign In
How to Retrieve session id
#5

You have to load session library. Add a __construct method to the Login controller and load the library. This will let you access to the library's functions in any method inside the controller. 

I use to get the session data in the controller instead of the model. Then I pass the necessary values to the model's function in the arguments, but that is a personal preference.

PHP Code:
public function __construct()
{
 
       parent::__construct();
 
       $this->load->library('session');
 
       ...

Reply


Messages In This Thread
How to Retrieve session id - by Pankaj Kumar - 03-09-2018, 03:20 AM
RE: How to Retrieve session id - by donpwinston - 03-09-2018, 10:11 AM
RE: How to Retrieve session id - by InsiteFX - 03-09-2018, 01:50 PM
RE: How to Retrieve session id - by Pankaj Kumar - 03-14-2018, 03:14 AM
RE: How to Retrieve session id - by danielcr_2018 - 03-14-2018, 05:26 PM
RE: How to Retrieve session id - by Pankaj Kumar - 03-15-2018, 04:31 AM
RE: How to Retrieve session id - by InsiteFX - 03-15-2018, 06:30 AM



Theme © iAndrew 2016 - Forum software by © MyBB