sharing session data across multiple applications

#11
[eluser]danphilibin[/eluser]
Thanks for the help. Here's what I have now: if I log into the account center, I get a new entry in the session database that doesn't change. If I delete that record in the database and then visit the homepage (still logged in), it re-creates that entry in the database, and yet the logged in page still doesn't show.

So it seems like the session is there, it's just not being identified correctly.

Here's the code for my home controller, which should detect if the user is logged in or not. If they are, show the homepage, otherwise, show a landing page.

Code:
function index()
    {
        $is_logged_in = $this->session->userdata('is_logged_in');
        if(!isset($is_logged_in) || $is_logged_in != TRUE) {
            $this->load->view('landing');
            // $this->output->enable_profiler(TRUE);
        } else {
            $data['pageTitle'] = "Your one-stop shop for properties with potential.";
            $data['main_content'] = "home";
            $this->load->view('includes/template', $data);
        }
    }

Do I need to re-set the session data before I can start using it? When I log in, a function gets the user's information and sets the userdata so I can use it anywhere I want. Do I have to do that process again for each application?

#12
[eluser]danphilibin[/eluser]
Not sure why, but now it *does* insert a new row into the database when I switch from back to front. The userdata is blank.

#13
[eluser]danphilibin[/eluser]
Got it!! I had to have the same encryption key for both applications. Thanks for all of the help!!

#14
[eluser]stommert[/eluser]
you're welcome...


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.