Forum Discussion

id-chalmers's avatar
11 years ago

getting client cookies name and value

What is the best way to A: check that a cookie of name "cookie-a" has been set in the client, and B: to get the value and expiration of cookie-a? I can do this fairly easily with javascript (documen...
  • ChiaraS's avatar
    11 years ago

    Hi,

     

    this should work:

     

    <#assign cookie = http.request.cookies.name.get("cookie-a") />
    <#if cookie?? && cookie.value?? && (cookie.value == "value")>
    todo
    </#if>