I am trying to get the cookies value in portal_normal.vm of my custom liferay theme.
At first I am setting a cookie value on click event using JavaScript. In some pages I able to get the cookies in theme but some pages I am not able to get the cookie value,but when I check in f12 cookies it is present.
Below is code for setting cookie using JavaScript:
$('.close').click(function(){
document.cookie = "cookie_set=true;path=/";
$('.close').attr("data-dismiss","alert");
});
Liferay custom theme to get the cookie:
#foreach($cookie in $request.getCookies())
#if ($cookie.getName() eq "cookie_set")
#set($previousWeb = $cookie.getValue())
#end
Problem here is I am able to get the cookie value in some pages.
Can any one help me out?
Thanks, Naresh.