How we can check if a session variable exists in Mangento. I know how to create a new variable.


My aim is to check if session variable MyValue exists. If exists do nothing otherwise create one

  • did I manage to answer your question ? If so could you please mark your question as answered. – Raphael at Digital Pianism Mar 24 '16 at 9:42

You can do:

if (Mage::getSingleton('core/session')->getMyValue())
    // Value exists, do stuff
    // Value does not exists, do other stuff
|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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