Magento – Event on First Load

event-observer

I want to set some data may be in the cookies when visitor first load the website URL. The url can be any. It can be a category page, product page etc. Is there any event so that I can set that data in cookie?

Can I use controller_front_init_before event?

Best Answer

To my understanding controller_front_init_before is not the best way for setting a cookie as you can miss some redirects and also you have a minimal data in your disposal.

I would recommend using controller_front_send_response_before as the last event triggered before output is sent to browser.

Related Topic