I have a cookie that I need to be read in Javascript, so I need to remove the httponly part of the cookie from it.
This is the cookie I need to modify:
Set-Cookie: wordpress_c3d46b752402579c18e981091b8c940c=admin%7C1463963639%7CWsIehTVJh4%7C7ee6e8117b6b; expires=Mon, 23-May-2016 12:33:59 GMT; Max-Age=1252800; path=/wp-content/plugins; domain=.example.org; HttpOnly
I just need to strip the HttpOnly string at the end of the cookie
PS: I know that I'm introducing a potential security problem here.
There are Nginx Lua modules and code snippets that can do this, for example:
https://github.com/cloudflare/lua-resty-cookie
First grab the cookie:
You can then set it with httponly false:
This is possible using Lua:
nginx.conf: