Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to access standard PHP session data from inside CodeIgniter

I've got a Codeigniter project I'm working on, and using the CI Sessions (stored in a DB), but I need to check for a variable in another $_SESSION from another application (in the same cookie domain), but when I try, from the CI controller to use native PHP sessions to get this one bit of info ($_SESSION['blah']), it looks like CI is stripping out that global $_SESSION data. Anyone know a way I can get at it? I'd like to basically do something like this (with a little more error checking of course):

if (isset($_SESSION['user_id'])){
      $this->session->set_userdata('usermap', $_SESSION['user_id']);
}

any help would be appreciated.

like image 691
mogmismo Avatar asked Jul 30 '26 18:07

mogmismo


1 Answers

Have you put session_start() in your index.php?

like image 185
Paul Avatar answered Aug 01 '26 07:08

Paul