Jump to content

Admin/Backend login redirect to login page in version 1.4.4.1


Recommended Posts

Admin/Backend login redirect to the login page in version 1.4.4.1,I have tried to solve as many solvotions on the internet.but it still can not be solved. This happended today and it works very well before.

 

 

the following three solutions i have tried but it do not work.

 

1.

in the login.php file (around line 54 )at the top there is a cookie set that i changed

from:

$cookie = new Cookie('psAdmin', substr($_SERVER['PHP_SELF'], strlen(__PS_BASE_URI__), -10));

to:

$cookie = new Cookie('psAdmin', substr($_SERVER['REQUEST_URI'], strlen(__PS_BASE_URI__), -10));

and it worked for me ... the file is located in your admin folder

 

2.

I really found a bug!

The problem was in the two files, login.php and init.php. This two files are found in Admin folder and are responsible for validating the admin’s credentials. So, when those files send or get a cookie to/from the browser they get wrong with this two lines:

init.php

$cookie = new Cookie(‘psAdmin’, substr($_SERVER[‘SCRIPT_NAME’], strlen(PS_BASE_URI), -strlen($currentFileName[‘0’])));

login.php

$cookie = new Cookie(‘psAdmin’, substr($_SERVER[‘PHP_SELF’], strlen(PS_BASE_URI), -10));

Thoses lines are not sending a correct path to the browser. Maybe that’s because I use sites other than the main site as virtuals home pages. To fast correct the problem I put explicity the path by my self. So, the lines were just as:

login.php

$cookie = new Cookie(‘psAdmin’, “admin445” );

init.php

$cookie = new Cookie(‘psAdmin’, “admin445”);

 

After the change everything worked nice.

I hope this can help someone. About me, I’m gona sleep because I spent a lot of time to fix this and here in Brazil are 01:15AM and, as soon as I wakeup I’ll take a Cisco exame wink

Thank's to

all!

3.Note: there is still an issue with server using a proxy to use the same port 80 with http and https. If this is your case, just replace

 

OR strtolower($_SERVER['HTTPS']) == 'off')by

OR 0for a temporary fix.

  • Like 1
Link to comment
Share on other sites

  • 1 month later...

I really like that post and really tried to do this on actual version of prestashop but it didn't work.

 

 

I have completed to installing of my online store. I added the directory name to the URL of my domain. When I try to login to the back-end, tell me that the "employee does not exist or password is incorrect." Then I order to Prestashop send me other password, but I didn't receive anything in my e-mail. Can anybody explain me what I can to do to continue my online store?

 

Thanks a lot,

Paula

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...