Zen Cart Logo
Forums / General Questions / Can't login to admin

Can't login to admin

Locked

Views: 50,598

Results 61 to 80 of 165
This thread is locked. New replies are disabled.
21 Aug 2007, 6:51 PM
#61
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Can't login to admin

You had quoted beerdawg earlier:> 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:

http://us.php.net/manual/en/function.session-regenerate-id.php

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:

if(!version_compare(phpversion(),"4.3.3",">=")){
setcookie(
session_name(),
session_id(),
ini_get("session.cookie_lifetime"),
"/"
);
}

> 
> Herb.

> **denny1:**
>
> I am having the same login problem..  So do I add this code to the config file? If so which config file?
> ```
  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:```
if(!version_compare(phpversion(),"4.3.3",">=")){
setcookie(
session_name(),
session_id(),
ini_get("session.cookie_lifetime"),
"/"
);
}

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

21 Aug 2007, 6:52 PM
#62
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Can't login to admin

And clear your browser cache and cookies.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

21 Aug 2007, 7:20 PM
#63
denny1 avatar

denny1

New Zenner

Join Date:
Aug 2007
Posts:
13
Plugin Contributions:
0

Re: Can't 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?

21 Aug 2007, 7:25 PM
#64
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Can't login to admin

Do you mind sharing the admin username/password so I can try it from here ?

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

21 Aug 2007, 7:30 PM
#65
denny1 avatar

denny1

New Zenner

Join Date:
Aug 2007
Posts:
13
Plugin Contributions:
0

Re: Can't login to admin

I sent it in a Private Message

21 Aug 2007, 7:30 PM
#66
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Can't 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.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

21 Aug 2007, 7:32 PM
#67
denny1 avatar

denny1

New Zenner

Join Date:
Aug 2007
Posts:
13
Plugin Contributions:
0

Re: Can't login to admin

"you entered the wrong username or password"

It should be in all lower case

21 Aug 2007, 7:35 PM
#68
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Can't login to admin

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

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

21 Aug 2007, 8:01 PM
#69
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Can't login to admin

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:

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

21 Aug 2007, 8:02 PM
#70
denny1 avatar

denny1

New Zenner

Join Date:
Aug 2007
Posts:
13
Plugin Contributions:
0

Re: Can't 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...

21 Aug 2007, 8:05 PM
#71
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Can't login to admin

Yes, undo all the coding changes I had suggested.

The admin username/password is the information you selected for the Admin account during installation ... on the last page of the zc_install process.

They are not the same as what's in your configure.php files (well, unless you used that information there too, which I don't recommend).

You had entered "denny" and some password ... that's what you should use to login to the admin.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

21 Aug 2007, 8:10 PM
#72
denny1 avatar

denny1

New Zenner

Join Date:
Aug 2007
Posts:
13
Plugin Contributions:
0

Re: Can't login to admin

Thanks again,

I have no idea where I entered "Denny" as a UN... I owe you big time for the help today..

Go get your coffee...

Thanks

17 Dec 2007, 3:47 PM
#73
misty avatar

misty

Inactive

Join Date:
Apr 2004
Location:
UK
Posts:
5,752
Plugin Contributions:
1

Re: Can't login to admin

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:

http://us.php.net/manual/en/function.session-regenerate-id.php
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:

if(!version_compare(phpversion(),"4.3.3",">=")){
setcookie(
session_name(),
session_id(),
ini_get("session.cookie_lifetime"),
"/"
);
}

>  
> Herb.
Thanks very much for posting this fix re PHP-4.3.2
:hug:

Dezina ZenCart Templates
Please do not PM for support queries..Post in forums..help others

20 Dec 2007, 10:02 PM
#74
gayelston avatar

gayelston

New Zenner

Join Date:
Aug 2006
Location:
Wales
Posts:
80
Plugin Contributions:
0

Re: Can't login to admin

Hi,
Well I'm having exactly the same problem logging in, so I installed the clear cache thing & used it several times, but still can't log in using firefox - my prefered browser.
Just to make sure, I tried Internet Explorer for the first time in months, & that works fine!
I also tried creating an account as a customer through Firefox & that worked fine.
What on earth is going on?
This is a new install of 3.8, which worked fine including the login, then putting in a copy of my current database after dropping the tables of the install d/b.
That's when the problems started.
This has happened to me before when trying to update on a practice shop just to make sure I didn't stuff up a live one.!
Thought I kept doing something wrong until I found this string
My php is an old one: 2.11.1 with mysql 4.1.22.
Apache server: Unitedhosting.co.uk
Hope someone can help
Regards
Gay:dontgetit

20 Dec 2007, 10:13 PM
#75
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Can't login to admin

gayelston:

My php is an old one: 2.11.1 with mysql 4.1.22.Um ... what?
Are you sure that's your PHP version?

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

15 Jan 2008, 10:40 AM
#76
robb58 avatar

robb58

New Zenner

Join Date:
Jan 2008
Posts:
6
Plugin Contributions:
0

Re: Can't login to admin

Hi, I'm new to the forum so hello to everyone. :clap:

I've just done a test install of zen cart via the fantastico automatic install section of my hostgator account (running php v 4.4.7). The version of Zen it installs is 1.3.7.1 which I now know to be an old version - however it will probably suffice for now.....

Unfortunately I'm having exactly the same admin log in problem as the other posters on this topic, i.e I can't access the admin section. When I log in it just refreshes the admin log in page with cleared input boxes. If I type in the wrong user name or password, I get the same result - no error messages.

I've tried a lot of the fixes described here but I'm merrily getting lost in the myriad of solutions offered - none of which seem to work. I've done several reinstalls but I get the same result :frusty:. Is there any one solution which seems to be successful in the majority of cases

15 Jan 2008, 7:56 PM
#77
robb58 avatar

robb58

New Zenner

Join Date:
Jan 2008
Posts:
6
Plugin Contributions:
0

Re: Can't login to admin

ok... uopdate... I bit the bullet and installed the 8a version. Dream of an installation so I vebtured to the admin panel and ebtered my user name and pw. First hic-up, it said I'd got the wong password, so i asked for a reset and put the new password in . Voila!! it worked.. so filled with confidence I changed my password and logged out to see if the log in would work. Guess what? same old problem came back... help

15 Jan 2008, 11:41 PM
#78
robb58 avatar

robb58

New Zenner

Join Date:
Jan 2008
Posts:
6
Plugin Contributions:
0

Re: Can't login to admin

latest.... admin opens fine with firefox... not so IE. It's a start, but there are times I'l need IE.

16 Jan 2008, 6:14 AM
#79
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Can't login to admin

Is it possible that your browser cache/cookies needs to be emptied?

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

16 Jan 2008, 6:35 AM
#80
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,843
Plugin Contributions:
17

Re: Can't login to admin

or... IE is remembering an old password?

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com