0

I am building a single page app with react, and using devise.

I would like to be able to signout without reloading the page.

Currently following other examples I do an ajax call to the server, run the devise sign_out method, and then finally force the page to reload.

Works but its not nice.

It seems like I have to reset some part of the session on the client when I signout?

Is there anyway to do this?

Mitch VanDuyn
  • 2,838
  • 1
  • 22
  • 29
  • Not too sure how devise works, but it may be enough to simply remove the session cookie and update your app's state. – Deividas Jun 25 '17 at 14:57
  • Thanks. Do u know how to remove the session cookie? – Mitch VanDuyn Jun 25 '17 at 14:58
  • You can use this https://stackoverflow.com/questions/179355/clearing-all-cookies-with-javascript or use this https://www.npmjs.com/package/cookie for some advanced controls. – Deividas Jun 25 '17 at 15:02

0 Answers0