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 refreshed too late #8349

Closed
Closed
@kkozmic

Description

@kkozmic

In one of my controller I'm calling an $http endpoint, which serverside sets a new session cookie (let's call it myCookie) and in .success() I'm navigating to another route. (via $location.path(/someRoute);.

I also have a $rootScope.$on('$routeChangeStart') handler, that checks for a cookie (via $cookies.myCookie and does some stuff depending on what it finds.

The problem is, that by then, the cookie is not yet set on the $cookies service, so the logic executed is wrong.

Am I doing something totally wrong here? Is there a way to force the $cookies service to refresh itself or any other, better way to handle the scenario I'm describing?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions