1

i have this Code in my first PHP File

session_start();
print_r($_SESSION);
echo 'Session-ID: '.session_id();

And the Same on a second PHP File. Its same Domain.

In the First file, i can see some Session Informations from Login with CodeIgniter. Here the Result:

Array ( [__ci_last_regenerate] => 1508770297 [username] => [email protected] [role] => 1 [name] => [email protected] [id] => 1 [login] => 1 ) Session-ID: f9fn1bi0ioucr57d2j050elnca8i0veg

On the second file, this is the result

Array ( ) Session-ID: f9fn1bi0ioucr57d2j050elnca8i0veg

Its the Same Session-ID but i cannot get the username on second file :(

5
  • Is this perhaps what you are looking for? stackoverflow.com/a/2306168/1607393 Commented Oct 23, 2017 at 16:16
  • Nope. I have things in array as you see, but only in one php file. Its same Domain but in 2nd PHP File the Array is Empty... but idk why Commented Oct 23, 2017 at 16:51
  • Is there any www different in the domain :D Commented Oct 23, 2017 at 17:09
  • All www domain. All the Same. Commented Oct 23, 2017 at 17:12
  • Why are you using session_start? just use $this->session->set_userdata($data); make sure your session library is loaded ($this->load->library('session');) Read the users guide on the sessions library Commented Oct 24, 2017 at 2:39

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.