Support the ongoing development of Laravel.io →
posted 9 years ago
Session
Last updated 2 years ago.
0

Anyone ???

Last updated 2 years ago.
0

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.

Last updated 2 years ago.
0

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

Last updated 2 years ago.
0

hello ?? anyone ?

Last updated 2 years ago.
0

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 :

  1. Build a simple Magento module that will observe the login and logout events and record the users email and timestamp in a custom table.
  2. pass the users name/email when redirecting to the laravel Q& A app.
  3. 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.

Last updated 2 years ago.
0

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 :

  1. Build a simple Magento module that will observe the login and logout events and record the users email and timestamp in a custom table.
  2. pass the users name/email when redirecting to the laravel Q& A app.
  3. 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

Last updated 2 years ago.
0

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

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

zer0d4y zer0d4y Joined 13 Jun 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.