That package is for laravel 3, but just the API. Your looking for single sign on, probably by looking in the sessions made by Magento, or loading a part of the Magento core. When you figure out if they're logged in in Magento, you could force login that user in your Laravel app.
Ah you mean that if a user register himself on magento i have to update my database for laravel too. So the user has to login twice to get the session on both systems but he will 1 unique account. Do you mean that ?
thank you very much for your answer
You have a couple of options to solve this.
Assuming if the Magento Store and Q/A app share the same domain : You can easily share a session variable / cookie to do the needful.
If that is not the case you can do something like this :
that way you can avoid the authentication.
gayanhewa said:
You have a couple of options to solve this.
Assuming if the Magento Store and Q/A app share the same domain : You can easily share a session variable / cookie to do the needful.
If that is not the case you can do something like this :
- Build a simple Magento module that will observe the login and logout events and record the users email and timestamp in a custom table.
- pass the users name/email when redirecting to the laravel Q& A app.
- Query the custom table from within laravel to check if there is an ongoing session for the given username.
that way you can avoid the authentication.
Dear gayanhewa, first thank you very much for your answer ! I think the option 1 would be much easier but the question is: Can i do the session variable sharing also with a subdomain and main domain ? For example :
the magento shop is hosted on : www.website.com/magento and the q&a on a subdomain : qa.website.com
would the option 1 possible with that structure ?
Regards
So basically if u are hosting both site under the same domain : you can use something like this :
Note the $domain
bool setcookie ( string $name [, string $value [, int $expire = 0 [, string $path [, string $domain [, bool $secure = false [, bool $httponly = false ]]]]]] )
More details : http://www.php.net/manual/en/function.setcookie.php
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community