I am creating a custom blog, in which I use the \Magento\Framework\Registry and it is deprecated.

I searched for solution but I could only find the way to get the data without registry.

Is there's any way to set data without registry?

  • you can use custom var session for that Jan 2, 2020 at 14:26
  • Did you fix this, Haerriz? Dec 22, 2021 at 14:33
  • Nope haven't found a fix for it yet @PKTG
    – Haerriz
    Dec 23, 2021 at 5:19
  • Did you try the articles in the link in the answers below? Dec 23, 2021 at 5:28

2 Answers 2


I suggest you to read this article with discussion in the comments(!) -


Shortly: don't use session, use own class for registry.

As example: https://github.com/Vinai/module-current-product-example


Hope it will helpful to you

you can use like that in helper function or block function

and set your custom variable in that

public function sessionData()
        $this->session->setData('custom', 'value');

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.