Re: unable to login to admin
You had quoted beerdawg earlier:
Quote:
Originally Posted by
beerdawg
It seems that logging into the admin pages with zen-cart-1.3.7.1 using PHP-4.3.2 is broken. After entering the correct login/passwd, it will just return back to the login page.
The issue has to do with the call to session_regenerate_id() from zen_session_recreate() in
includes/functions/sessions.php (which is called from admin/login.php).
According to the php documentation for php, "Version 4.3.3: Since then, if session cookies are enabled, use of session_regenerate_id() will also submit a new session cookie with the new session id." See the documentation here:
That means that 4.3.2 does not submit a new session cookie with the new session id.
The fix provided by buraks78 in the comments in the link above seems to address the issue and fix the zen-cart login to the admin page.
Basically, add this directly after the call to session_regenerate_id() in includes/functions/sessions.php:
Code:
if(!version_compare(phpversion(),"4.3.3",">=")){
setcookie(
session_name(),
session_id(),
ini_get("session.cookie_lifetime"),
"/"
);
}
Herb.
Quote:
Originally Posted by
denny1
I am having the same login problem.. So do I add this code to the config file? If so which config file?
Code:
if(!version_compare(phpversion(),"4.3.3",">=")){
setcookie(
session_name(),
session_id(),
ini_get("session.cookie_lifetime"),
"/"
);
}
AND/OR
do I use sub-domain to make it all work????
ANY help would be great..
Thanks,
Denny
You could still try it, even though your PHP version is newer than the 4.3.2 issue they mentioned.
Edit the file they mentioned:
/includes/functions/sessions.php
Find the text they mentioned:
session_regenerate_id();
Add the code they mentioned:
Code:
if(!version_compare(phpversion(),"4.3.3",">=")){
setcookie(
session_name(),
session_id(),
ini_get("session.cookie_lifetime"),
"/"
);
}
Re: unable to login to admin
And clear your browser cache and cookies.
Re: unable to login to admin
I added the third line to the config file.. NO change..
I added the code into the sessions file.. No change..
I cleared the cache and cookies.. No change..
I got all the emails form the store..
I tried it in both browsers..
Should I try a sub-domain?
Re: unable to login to admin
Do you mind sharing the admin username/password so I can try it from here ?
Re: unable to login to admin
I sent it in a Private Message
Re: unable to login to admin
Are you getting just a blind refresh of the page, or a message saying "you entered the wrong username or password"?
I'm getting the wrong username/password message.
It is case sensitive.
Re: unable to login to admin
"you entered the wrong username or password"
It should be in all lower case
Re: unable to login to admin
Quote:
Originally Posted by
denny1
I can get to the store front and I can create an account and login to it. Everything seems to be working fine. When I try to access the admin it says I have entered the wrong username and password. I have checked and rechecked and I am entering the correct username and password.
Hmmm ... you *did* say that, didn't you ...
And here I was thinking you had the same thing as the others. I need more coffee.
Let's do a password-reset first:
https://www.zen-cart.com/tutorials/index.php?article=2
Re: unable to login to admin
Quote:
Originally Posted by
denny1
Should I try a NEW Install?
I guess I should have said yes to this one ... because it would have forced the re-entry of a username/password :blink:
Re: unable to login to admin
Unbelievable!!! I made the changes to the DB and it let me in.. I just double checked my config file and it shows that I was using the correct UN and PW and the right case..
Should I go back and undo the changes I made to the sessions file and delete the config file I added?
Do you have any idea why it wouldn't except my UN and PW?
Thanks for the patience and the time you spent on this...