magento2 icon indicating copy to clipboard operation
magento2 copied to clipboard

Impossible to retreive the customer id of the session in an external script

Open torresl opened this issue 13 years ago • 1 comments

I created an external script test.php of Magento But, i don' t succeed to retreive the customer id of the session.

the script is as follows : "<?php

require_once DIR . '/app/bootstrap.php';

$params = array( Mage::PARAM_RUN_CODE => '', Mage::PARAM_RUN_TYPE => 'store', 'entryPoint' => basename(FILE) ,
);

$entryPoint = new Mage_Index_Model_EntryPoint_Indexer(BP, $params); $entryPoint->processRequest();

$customer_id = Mage::getSingleton('Mage_Customer_Model_Session')->getCustomerId() ;

echo " customer_id session : ".$customer_id;

" To test, firstly, i authentificate a user via Magento. Secondly, i launch the script test.php. But the customer id isn' t displayed.

Thanks to explain how to retreive session customer data in an erternal script ? .

torresl avatar Feb 17 '13 02:02 torresl

Hello. Unfortunately we don't have the capacity to help with programming questions right now. We suggest you use one of the places designed for asking such question, eg http://magento.stackexchange.com/

magento-team avatar Feb 19 '13 19:02 magento-team