Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Persistent cookie may be unauthenticated #1103

Open
rickygu opened this issue Mar 5, 2018 · 5 comments
Open

Persistent cookie may be unauthenticated #1103

rickygu opened this issue Mar 5, 2018 · 5 comments

Comments

@rickygu
Copy link

rickygu commented Mar 5, 2018

I'm using

"ng-token-auth": "^0.0.30",
"angular-cookie": "^4.1.0"

with

devise_token_auth (0.1.42)

I have an angular cordova app which I want the user to be always signed in unless they sign out.
I have devise_token_auth.rb set to

config.token_lifespan = 999.years

and checking the client side cookie it says the cookie expiry unix time 33045606682, which is year 3017. However my client apps would still get 401 Unauthorized once in a while. I haven't been able to reproduce it consistently on when I would get a 401, but it has happened a few times. Just wondering if anyone knows if there may be other factors I haven't looked at that can cause the client side to be unauthenticated?

@zachfeldman
Copy link
Contributor

I had issues like this when I had config.change_headers_on_each_request set to true @rickygu . Have you tried turning this option off and seeing if you still have the problem?

@rickygu
Copy link
Author

rickygu commented Mar 6, 2018

@zachfeldman my change_headers_on_each_request is already set to false. I found the performance hit on true was too high and it was buggy when I have burst of request.

@zachfeldman
Copy link
Contributor

Hmm I don't have a ton of ideas then...

@jaimearroyonavia
Copy link

I have the same problem with the same version devise_token_auth (0.1.42) @rickygu , you find a solution for this?

@theblang
Copy link
Contributor

@rickygu @Kensk8 Quick question, were y'all just seeing this in a Cordova app? I'm curious what you mean about a "Persistent cookie". It's my understanding that cookies don't work in Cordova. Also, we just added cookie support in #1453 .

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

No branches or pull requests

4 participants