Hi All,
I am trying to create a serverside httponly cookie from the livesite component to check whether the user is a first time user (or) not.
Requirment: If it is his first visit, (i.e) the cookie does not exist, hence I will display a message to the user and then I set a cookie. However, if its his second attempt, since the cookie already exists in that machine, I will not display anything to the message.
As per my current implementation, I am writing a Java External method to check and create cookie at the backend. Two major issues in this approach are
1. Component gets cached, hence for the second time the External is not at all being called from component.
2. To avoid the issue in point 1, I use a precontroller to check the cookie condition, however, my target page will be executed only after index.page and homepage.page, the cookie will get created by the time it reaches the target page.
My question is, can we create a cookie from livesite component alone without java implementation? If so, how?
Please through some light.