0

I set Session variable for my array and I want to use on another page, but Nothing found in return. Like: (In My custom Module's Controller file) Here $datas is My array.

Mage::getSingleton('adminhtml/session')->setDatas($datas);

And Use :

$my_data = Mage::getSingleton('adminhtml/session')->getDatas();

echo"<pre>";print_r($my_data);

But not get anything. Please suggest what can I do.

1
  • Please check my answer and let me know Commented Sep 6, 2016 at 16:34

2 Answers 2

0

I dont know this will work or not but you can try like this

Mage::getSingleton('adminhtml/session')->setData($datas);
$my_data = Mage::getSingleton('adminhtml/session')->getData();
print_r($my_data);

Use setData() and getData() instead of Datas

Please try and let me know

0

Please use admin/session instead of adminhtml/session

$datas = 'Hello world';

Mage::getSingleton('admin/session')->setDatas($datas);

$my_data = Mage::getSingleton('admin/session')->getDatas();

echo"<pre>";print_r($my_data);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.