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

$cookies refreshed too late #8349

Closed
kkozmic opened this issue Jul 26, 2014 · 5 comments
Closed

$cookies refreshed too late #8349

kkozmic opened this issue Jul 26, 2014 · 5 comments
Assignees

Comments

@kkozmic
Copy link

kkozmic commented Jul 26, 2014

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?

@jeffbcross jeffbcross self-assigned this Jul 26, 2014
@jeffbcross
Copy link
Contributor

@kkozmic can you create a plnkr will a reduction of your issue?

@IgorMinar
Copy link
Contributor

dupe of #6411 and #7631 ?

@kkozmic
Copy link
Author

kkozmic commented Jul 26, 2014

@IgorMinar yeah, you could say that (especially #7631 looks very much like the same problem)

@petebacondarwin
Copy link
Contributor

@kkozmic - can we close this one then?

@kkozmic
Copy link
Author

kkozmic commented Jul 27, 2014

yup

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants