Search code examples
javascriptangularjsgoogle-chromegrailscookies

Cookies doesn't appears in Chrome Console Resources tab


I'am working an a Grails app and create different cookies.

Some appears in the chrome console Resources TAB and some are not showing.

I need to get the value of these Cookies using Angularjs and can access only the one that are showing on console Resources TAB.

The other cookies are visible in the Chrome Content settings button. In the Cookies section, but not in the Chrome console Resources TAB.

All cookies are created the same way:

Cookie cookie = new Cookie("username", username)
cookie.maxAge = 1209600 //14 days
cookie.httpOnly = true
response.addCookie(cookie)

Thanks for your help.


Solution

  • Ok the problem was the path. To be visible in all the page the path must be "/"

    cookie.setPath("/")