Hon Posted June 4, 2009 Share Posted June 4, 2009 Now, my site cannot logoutWhen we login and try to logoutit will redirect to "index.php?mylogout" and there is nothing show on the screen.I try to change in init.phpif (isset($_GET['logout']) OR ($cookie->logged AND Customer::isBanned(intval($cookie->id_customer)))){ $cookie->logout(); Tools::redirect(isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : NULL);}elseif (isset($_GET['mylogout'])){ $cookie->mylogout(); //Tools::redirect(isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : NULL);Tools::redirect('index.php'); <==== Change at here!!!!!!!!!!!!!!}But, there still not workAfter clieck Logout, it still stay at the "index.php?mylogout" and there is nothing show on the screen.Please give me some suggection Link to comment Share on other sites More sharing options...
Patric Posted June 4, 2009 Share Posted June 4, 2009 Please specify the following infos :Installation type (new/update) :PS version :Theme (default/custo) :Code (original/modified) :Host :Browsers used : Link to comment Share on other sites More sharing options...
Hon Posted June 5, 2009 Author Share Posted June 5, 2009 PS version : 1.1Theme (default/custo) : Modify from defualt themeCode (original/modified) : ModifyBrowsers used : IE 7 && Firefox 1.5At last week, the logout process was worked. But, after I modify something more on my website ==> now it cannot logout.You can try at www.sawadeekorea.net/prestashop/ (it's only THAI language, but you can try the login-logout process)Thx in advance Link to comment Share on other sites More sharing options...
Hon Posted June 5, 2009 Author Share Posted June 5, 2009 After i try to debug the code:The code wad die in the init.php at here: if (isset($_GET['logout']) OR ($cookie->logged AND Customer::isBanned(intval($cookie->id_customer)))) { $cookie->logout(); Tools::redirect(isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : NULL); } elseif (isset($_GET['mylogout'])) { echo "check01"; $cookie->mylogout(); Tools::redirect(isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : NULL); echo "check02"; <=== The code is stopped here and doesnot execute this line } And after i go to Tools.php it look like the "exit" is doesn't work: static public function redirect($url, $baseUri = __PS_BASE_URI__) { echo "TOOL>Redirect"; <== It can show this line if (isset($_SERVER['HTTP_REFERER']) AND ($url == $_SERVER['HTTP_REFERER'])) { header('Location: '.$_SERVER['HTTP_REFERER']); echo "C1"; <== It can show this line } else { header('Location: '.$baseUri.$url); echo "C2"; } echo "BeforeExit"; <== It can show this line exit; <== It seem that the "Exit" it doesnot work !!! So it cannot return to Init.php page } How to fixed?? Link to comment Share on other sites More sharing options...
Hon Posted June 5, 2009 Author Share Posted June 5, 2009 Ohh i can solve it now!!Just have some free space before the first line in "index.php" page!!After i delete that space, it's work! Link to comment Share on other sites More sharing options...
Praveen.999 Posted June 8, 2010 Share Posted June 8, 2010 Hi, I faced the same problem from long. Now i got the solution for it. First you have to remove the custom module added from control panel.second in init.php use "SCRIPT_URI" instead of "HTTP_REFERER".These two modification resolved my logout issue. I hope same will work for you. Link to comment Share on other sites More sharing options...
mecollectibles Posted May 12, 2011 Share Posted May 12, 2011 I use Prestashop Version 1.3.2.3 & the same problem I have that customers cannot sign out.Anybody can help solve the problem? Link to comment Share on other sites More sharing options...
darqor Posted June 28, 2011 Share Posted June 28, 2011 Hello!prestashop 1.3.2I had the same problem with the logout.edit index.php from root, and this inside the comas ''<?php'' -has to be in the first line! no enter before it! like Hon wrote it!thx Hon! Link to comment Share on other sites More sharing options...
Recommended Posts