Jump to content

[SOLVED] Always redirected to login screen


Molina

Recommended Posts

Hi guys,

I just finished to install Prestashop and I faced no problem until I tried to logon as admin on the Back Office. Every time I try to log into BO I am redirected to the same login screen.

What I did:

1 - searched on the forum and applied every solution that was sugested to problems like what I'm having;
2 - cleaned the cache, switched from Firefox to Internet Explorer, accessed from another computer, from another network, etc;
3 - tried to edit path on the file settings.inc.php, etc;

I have a webpage on www.dxclub.com.br and I installed Prestashop in www.dxclub.com.br/loja.

If anyone can help-me it will be very nice!

Thank you!


**********************UPDATE*********************

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
//*********BUGGY***********
$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 ;-)

Thank all!

Link to comment
Share on other sites

  • 2 months later...
Hi guys,

I just finished to install Prestashop and I faced no problem until I tried to logon as admin on the Back Office. Every time I try to log into BO I am redirected to the same login screen.

What I did:

1 - searched on the forum and applied every solution that was sugested to problems like what I'm having;
2 - cleaned the cache, switched from Firefox to Internet Explorer, accessed from another computer, from another network, etc;
3 - tried to edit path on the file settings.inc.php, etc;

I have a webpage on www.dxclub.com.br and I installed Prestashop in www.dxclub.com.br/loja.

If anyone can help-me it will be very nice!

Thank you!
_____________________________________________________________________

Thanks for sharing this information... It worked for me as well



**********************UPDATE*********************

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
//*********BUGGY***********
$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 ;-)

Thank all!
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...