Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

$cookies doesn't represent current state of document.cookie #7631

Closed
@amaltson

Description

@amaltson

In an $http login call that we make, the resulting header has a Set-Cookie. While the cookie does get set in the browser, i.e. I can see it in document.cookie, it doesn't make it's way to $cookies.

Below is the response header setting the cookie:
response-header-cookie

And here is document.cookie indicating the cookie exists but $cookies doesn't see it.
nothing-in-cookies

The strangest thing is on the next Angular action I take, $cookies has the cookie. The example above is already wrapping the $cookies check in a $timeout to give the browser time to digest.

The workaround right now is to parse document.cookie and set $cookies manually, but this is super hacky.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions