Welcome Guest, Not a member yet? Register   Sign In
Session with different Controlers
#1

[eluser]The Wizard[/eluser]
Hello FriendsSmile

I've a question.
I'm setting up Session Data for a Controller called 'User'.

When i try to access the session data from a Controller called
'Remote' i somehow cannot access it without setting it IN the Controller.

That has no meaning because i need to access the session the Controller 'User'
has set.


The session code is in a Model and looks like:

Code:
function Session_Create( $array_session )
    {

        $this->load->library('session');
        
        $data = array(
            'userid'    => $array_session ['id'],
            'username'  => $array_session ['username'],
            'email'     => $array_session ['email'],
            'logged_in' => TRUE,
            'domains'   => array( ),

            'themeid'    => $array_session ['themeid']
        );

        $this->session->set_userdata( $data );

    }

The code for checking the session is like:
Code:
function Session_Check ()
    {

        $this->load->library('session');

        $session_auth     = $this->session->userdata('logged_in');
        $session_id        = $this->session->userdata('userid');

        if ( $session_auth == FALSE )
        {
            return FALSE;
        }
        else
        {
            return TRUE;
        }

    }

Both controls access the same Model but like i sayed, it works only
in THE controller, where it is set.

If someone can help me, i would be very grateful.

Thanks in advanceSmile
#2

[eluser]The Wizard[/eluser]
anyone an idea?




Theme © iAndrew 2016 - Forum software by © MyBB