Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prestashop cant login in admin

Several days ago I couldn't access the admin panel on my site based on prestashop platform. After entering login and password, I was redirected to login page again and everything repeated.

The site is hosted on a dedicated server, where some other prestashop sites I am developing are hosted too. After trying to access the admin panel on these sites I get the same "error".

What do you think, what is problem?

Prestashop ver.: 1.4.7.3 and 1.4.8.2

Server: CentOs, PHP

like image 656
Cvalya Avatar asked Jul 04 '12 20:07

Cvalya


2 Answers

Here is some things you can try :

1/ Clear your browser cache and your cookies

2/ Try using Firefox instead of Chrome (which seems have some unexpected problems)

3/ Check PS_SHOP_DOMAIN and PS_SHOP_DOMAIN_SSL in ps_configuration table

4/ Manually clear smarty cache : remove all files from tools/smarty/compile and tools/smarty/cache

5/ Disable the IP check in classes/Cookie.php (this can causes many issues with dynamics IP) : in isLoggedBack(), remove or comment the fourth condition :

AND (!isset($this->_content['remote_addr']) OR $this->_content['remote_addr'] == ip2long(Tools::getRemoteAddr()) OR !Configuration::get('PS_COOKIE_CHECKIP'))

6/ Make the expire time shorter for cookies (IE can have issues with longest time cookies) : in classes/Cookie.php constructor,

set : $this->_expire = isset($expire) ? (int)($expire) : (time() + 3600);

instead of $this->_expire = isset($expire) ? (int)($expire) : (time() + 1728000);

like image 60
zessx Avatar answered Sep 17 '22 20:09

zessx


I had the same issue after adding a NGINX as reverse proxy in front of my Apache web server.

The problem was from the « Check the IP address on the cookie » parameter set to « yes ». Since i was locked out from admin and could not change it, i did it directly in the database with this SQL request :

UPDATE ps_configuration SET value = 0 WHERE name='PS_COOKIE_CHECKIP';

PS : ps_ is my table prefix, you may adapt it to your settings.

like image 42
Nicolas Karolak Avatar answered Sep 19 '22 20:09

Nicolas Karolak