Sharing authenticated user in various applications


I’ve 2 applications and I’d like the user be able to access both of them by authenticating in any one.

What I mean is, if a user authenticate in app A1, then he can access the app A2 without having to login again.

I found out that by setting the application ID in config/main.php to the same value allows me to do it.

Is that enough ?


Once user has logged on any app, set a flag in session indicating that user has logged. When user changing from app to app check session flag first, if it indicate that user has logged then skip logging part and redirect to appropriate page.