i can access session data in my controller using \Magento\Framework\Session\SessionManagerInterface
public function __construct(
Context $context,
PageFactory $resultPageFactory,
\Magento\Framework\Session\SessionManagerInterface $session
)
{
$this->resultPageFactory = $resultPageFactory;
$this->session = $session;
parent::__construct($context);
}
// assign session then assess $this->session->setMessage("message") ;
In controller it is working . i need to retrieve session in view . how to i get that. $this->session->getMessage()
is not working in view
I need to check session values in phtml.
How to get session variable in magento.
getData('message')
instead ofgetMessage()