Page 1 of 1

"single sign-on" with another system sharing users table

Posted: Wed May 26, 2010 5:00 am
by jimmydahl
I'm building a system to be run parallell with an OpenCart installation and want the two systems to be "single sign-on".
  • They share the database and both systems uses the OpenCart installation customer table for its users (users in this case are what opencart call customers, not the administrator users).
  • My system only checks the customer_id $_SESSION variable to autorize users
  • My system sets these $_SESSION variables at login: language, currency, country_id, zone_id, cart and customer_id
  • I use the following lines when I start a session in the other system:

    Code: Select all

    if (!session_id()) {
      ini_set('session.use_cookies', 'On');
      ini_set('session.use_trans_sid', 'Off');
      session_set_cookie_params(0, '/');
      session_start();
    }
When I log in to OpenCart I get logged in to both systems, just as I want it, but when I log in to the other system I dont get logged in to OpenCart. What am I missing? I'd be very greatfull for any help!

Re: "single sign-on" with another system sharing users table

Posted: Wed May 26, 2010 11:10 pm
by jimmydahl
Nevermind, seems that the steps described above where all that was needed. Don't know why I didn't see it working yesterday, but today, just picking up where I left, it seems to work alright.