fusionauth-issues icon indicating copy to clipboard operation
fusionauth-issues copied to clipboard

Provide a standard way to read request cookies in Freemarker templates

Open lliu-20200701 opened this issue 2 years ago • 1 comments

Provide a standard way to read request cookies in Freemarker templates

Problem

Request cookies are accessible in Fusionauth 1.36.4 by "request.cookies" but no more supported by the same access method in Fusionauth 1.39.0

Solution

Provide a standard way to read request cookies in Freemarker templates.

Alternatives/workarounds

The following code snippet works in 1.39.0 but clumsy.

[#local cookies = request.getHeader("cookie")/] [#if cookies??] [#list cookies?split(";") as cookie] [#local keyVal = cookie?split("=")/] {keyVal[0]?trim?string} {keyVal[1]?trim?string} [/#list] [/#if]

Community guidelines

All issues filed in this repository must abide by the FusionAuth community guidelines.

How to vote

Please give us a thumbs up or thumbs down as a reaction to help us prioritize this feature. Feel free to comment if you have a particular need or comment on how this feature should work.

lliu-20200701 avatar Sep 28 '22 18:09 lliu-20200701

Internal:

  • https://github.com/FusionAuth/fusionauth-app/pull/144

robotdan avatar Sep 28 '22 20:09 robotdan