Jump to content

How to set and retrieve cookie values in PS 1.5.4.1?


kingsinnersoul

Recommended Posts

Hello,

I have a button which the user can change its state. I wish to be able to store the button's state for the user's session in a cookie (I guess its the best method?). I really have no experience with this issue but I have read several posts here in the forums but they all talk about 1.4 and earlier. I do understand that PS 1.5 has introduced the context and it replaced the way the code should be.

 

Can anyone share with me a code example of how can I create a variable in the cookie and set/access it? Is the access done fromt he tpl file or from the php file? (the button is in product-list.tpl)

 

Thank you

Link to comment
Share on other sites

  • 8 months later...
  • 9 months later...

Hello Everyone,

I have define the cookie in javascript file using document.cookie variable. the javascript file is store in my custom module. i have override OrderConfirmation controller into my module. now i want to access the javascript cookie into my override controller. i fetch cookie using $this->context->cookie variable but it is not working. please give me any idea or solution how i access cookie... 

 

Thank you very much in advance

Link to comment
Share on other sites

  • 3 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...