Skip to content
This repository has been archived by the owner on Dec 13, 2018. It is now read-only.

Object <#Session> has no method reset() when logging out #9

Closed
PradatiusD opened this issue Aug 15, 2014 · 3 comments
Closed

Object <#Session> has no method reset() when logging out #9

PradatiusD opened this issue Aug 15, 2014 · 3 comments

Comments

@PradatiusD
Copy link

Currently testing the stormpath module and found that every time I would log out I would receive this Object <#Session> has no method reset()

I checked my express-stormpath/lib/controllers.js and found this.

module.exports.logout = function(req, res) {
  if (req.session) {
    req.session.reset();
  }

  res.redirect('/');
};

I switched req.session.reset() to req.session.destroy() to fix this temporarily but I wanted to know what the root cause was. Let me know if there is any more info I can provide to help you.

Thanks!

@PradatiusD
Copy link
Author

My fault. The issue was caused by my own instance of express-session colliding with stormpath's. Closing this issue.

@bobbycircle
Copy link

Excuse me, but how does one prevent one's instance of express-session from colliding with stormpath's? I think I'm having the same problem. Thanks for any advice!

@robertjd
Copy link
Member

robertjd commented Feb 6, 2015

This part of the docs should help to explain it, let me know if you still have questions:

https://docs.stormpath.com/nodejs/express/product.html?highlight=session#session-management

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

3 participants