lonasito Posted December 4, 2013 Share Posted December 4, 2013 Hello, I am trying to create a function that will automatically log user out of PrestaShop when browser window is closed. Ideally it should all happen in JS with possibly an AJAX call. I already looked at this thread: http://www.prestashop.com/forums/topic/120515-logout-when-browser-is-closed/ Unfortunatelly, i wasn't able to implement this solution successfully. Can anyone help with that issue please? Perhaps there are other methods available. Link to comment Share on other sites More sharing options...
Anton_bcn Posted December 4, 2013 Share Posted December 4, 2013 Probably you need to use cookie or you own variable in you module, for example save there current session ID and when user get back see if this changed May be Prestashop do it for you and you just need to investigate cookie object for see what is in there. But its bad practice, because is very annoying if you need always sign in.... Hope its helps. Link to comment Share on other sites More sharing options...
PascalVG Posted December 4, 2013 Share Posted December 4, 2013 Problem is with even if you put your cookie to be a session cookie, Chrome and Firefox will keep it and reuse it after the browser has been closed, BUT the user has indicated to 'continue from last session'. Then the browser will do as if it still is the same session... (Done, because Chrome, and lately Firefox auto update and restart the browser after an upgrade, and they didn't want the user to have to log in after this...) :-( Link to comment Share on other sites More sharing options...
jaychennai Posted September 29, 2014 Share Posted September 29, 2014 For people looking for solution for 1.6 version classes/Cookie.php change the setexpire to this public function setExpire($expire) { $this->_expire = 0; } Link to comment Share on other sites More sharing options...
sancoLgates Posted January 26, 2015 Share Posted January 26, 2015 For people looking for solution for 1.6 version change the setexpire to this public function setExpire($expire) { $this->_expire = 0; } it's no use, i've changed $this->_expire to 0 , but still got the cookies even after i closed the browser... any other reference ? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now