Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Comment récupérer la session d ‘ un client authentifié dans un script externe sous Magento version 2 ? 
 
gostorm
Jr. Member
 
Total Posts:  8
Joined:  2011-06-01
 

After a customer authentication in Magento2 , i try to retreive the session in a external script, but no success :
the external script is :

Après qu’ un client se soit authentifié sous Magento 2, j’ essaie de récupérer sa session dans un script externe pas sans y parvenir:

Le script externe est le suivant :

“
require_once ‘app/bootstrap.php’;
$mageRunCode = isset($_SERVER[’MAGE_RUN_CODE’]) ? $_SERVER[’MAGE_RUN_CODE’] : ‘’;
$mageRunType = isset($_SERVER[’MAGE_RUN_TYPE’]) ? $_SERVER[’MAGE_RUN_TYPE’] : ‘store’;
Mage::init($mageRunCode, $mageRunType);
$sessiona= Mage::getModel(’Mage_Customer_Model_Session’);
echo var_export($sessiona);
?>
“
Le résultat est le suivant :
“
Mage_Customer_Model_Session::__set_state(array( ‘_customer’ => NULL, ‘_isCustomerIdChecked’ => NULL, ‘_persistentCustomerGroupId’ => NULL, ‘_skipSessionIdFlag’ => false, ‘_data’ => array ( ), ‘_hasDataChanges’ => false, ‘_origData’ => NULL, ‘_idFieldName’ => ‘id’, ‘_isDeleted’ => false, ))
“
If somebody knows how to retreive the session of a customer authenticated in an external script with Magento2, thanks to inform me how.

r
Si quelqu’ un sait comment récupérer la session utilisateur dans un scirpt externe, authentifité sous Magento version 2, merci de me le faire savoir.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top