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

Cookie "expires" is never set #119

Closed
awhitty opened this issue Feb 16, 2015 · 5 comments
Closed

Cookie "expires" is never set #119

awhitty opened this issue Feb 16, 2015 · 5 comments

Comments

@awhitty
Copy link

awhitty commented Feb 16, 2015

I may be interpreting this the wrong way, but in order for the user's logged-in session to last longer than the browser session, the cookie storing the auth tokens should have an expires property. #107 mentions this issue, but the issue was closed, and I do not think it has been adequately addressed.

As soon as a user refreshes the page, the user's session and relevant cookies have been lost, forcing the user to reauthenticate.

If it helps, I'm using the email/password authentication scheme.

The relevant code:

persistData: function(key, val, configName) {
  switch (this.getConfig(configName).storage) {
    case 'localStorage':
      return $window.localStorage.setItem(key, JSON.stringify(val));
    default:
      return ipCookie(key, val, {
        path: '/'
      });
  }
},

You can see that there is no expires: in the object passed to ipCookie. Is this the correct behavior?

@lynndylanhurley
Copy link
Owner

@awhitty - the token expiry is enforced by the server, so the cookies should remain in the browser indefinitely.

I did just find this in the ipCookie docs:

If you don't specify the expiry date the cookie is trashed when you close the browser.

I don't remember it working this way initially - I may have built against a version that didn't have this behavior.

Thanks for reporting the issue, I'll push a fix ASAP.

@realadeel
Copy link

Just checking if this is still imminent. Thanks!

@lynndylanhurley
Copy link
Owner

Hi @Proletarian - I'll push a fix for this tonight. Sorry for the delay.

@realadeel
Copy link

Woohoo! No worries. Appreciate the update.

On Monday, 18 May 2015, Lynn Dylan Hurley [email protected] wrote:

Hi @Proletarian https://github.com/proletarian - I'll push a fix for
this tonight. Sorry for the delay.


Reply to this email directly or view it on GitHub
#119 (comment)
.

Best regards,

Adeel Ahmad
CEO / Shopseen https://www.shopseen.com
Shopseen simplifies commerce.

Follow @shopseen everywhere
Instagram http://instagram.com/shopseen / Pinterest
http://pinterest.com/shopseen / Twitter http://twitter.com/shopseen /
Facebook http://facebook.com/shopseen

@lynndylanhurley
Copy link
Owner

Fixed in v0.0.25.

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

3 participants