CodeIgniter Forums

Full Version: Help with sessions?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

I want to create this.


$_SESSION['access'] = $access;

I believe I have the second part down.

Am I right in thinking that this will set the session 'access'?

$this->session->userdata('access') = $access;

If that is right, is session_start on by default?

El Forum

[eluser]GSV Sleeper Service[/eluser]
CI sessions are different to standard PHP sessions.

When using CI sessions you will not need to use session_start, but you will have to load or autoload the session Library.

you'd use this to set a CI session var
and this to read it back
$access = $this->session->userdata('access')