Forums / Installing on a Linux/Unix Server / Admin Login Issue - 1.3.7.1 and old version of PHP: 4.3.2

Admin Login Issue - 1.3.7.1 and old version of PHP: 4.3.2

Locked

Started by thehighlandsgroup on 1 Apr 2008, 5:13 AM · Views: 2,112

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
1 Apr 2008, 5:13 AM
#1
thehighlandsgroup avatar

thehighlandsgroup

New Zenner

Join Date:
Jul 2007
Location:
Denver, Colorado
Posts:
14
Plugin Contributions:
0

Admin Login Issue - 1.3.7.1 and old version of PHP: 4.3.2

So I've completed new install and having same issue logging in the Admin Panel. I'm running 1.3.7.1 and PHP 4.3.2.

For us novices with PHP can you give us a line number or even better yet a before snippet of code and after snippet of code?

The Highlands Group

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.

Gene Fourney
The Highlands Group
1435 Larimer St.
Denver, CO 80202
(303) 346-2255
https://www.thehighlandsgroup.us

1 Apr 2008, 6:21 AM
#2
misty avatar

misty

Inactive

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

Re: Admin Login Issue - 1.3.7.1 and old version of PHP: 4.3.2

So I've completed new install and having same issue logging in the Admin Panel. I'm running 1.3.7.1 and PHP 4.3.2.
Why install 1.3.7.1 when latest version 1.3.8.a would undoubtedly fix
your problem?

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

1 Apr 2008, 4:54 PM
#3
thehighlandsgroup avatar

thehighlandsgroup

New Zenner

Join Date:
Jul 2007
Location:
Denver, Colorado
Posts:
14
Plugin Contributions:
0

Re: Admin Login Issue - 1.3.7.1 and old version of PHP: 4.3.2

Sorry. My mistake. Version is 1.3.8a. So problem exists with latest version.

Gene Fourney
The Highlands Group
1435 Larimer St.
Denver, CO 80202
(303) 346-2255
https://www.thehighlandsgroup.us

1 Apr 2008, 7:27 PM
#4
thehighlandsgroup avatar

thehighlandsgroup

New Zenner

Join Date:
Jul 2007
Location:
Denver, Colorado
Posts:
14
Plugin Contributions:
0

Re: Admin Login Issue - 1.3.7.1 and old version of PHP: 4.3.2

I have run new password script to log into Admin section and changed password in backend. This is a fresh install. I am able to login successfully using Firefox browser but not IE 6.0. I've cleared cache, cookies and history in IE. I also went to cookie files and deleted. Firefox works and I can work in admin area but can't in IE?

What gives?

Gene Fourney
The Highlands Group
1435 Larimer St.
Denver, CO 80202
(303) 346-2255
https://www.thehighlandsgroup.us

2 Apr 2008, 12:35 AM
#5
thehighlandsgroup avatar

thehighlandsgroup

New Zenner

Join Date:
Jul 2007
Location:
Denver, Colorado
Posts:
14
Plugin Contributions:
0

Re: Admin Login Issue - 1.3.7.1 and old version of PHP: 4.3.2

As a matter of courtesy to other Zenners - I was able to resolve the issue on my own.

I added the code in the posting above where there are not 1 but 4 instances directly after the call to session_regenerate_id() in includes/functions/sessions.php file.

I rebooted computer, cleared cookies and files from IE and FF browsers. Cleared files in cache on server and voila it worked.

Gene Fourney
The Highlands Group
1435 Larimer St.
Denver, CO 80202
(303) 346-2255
https://www.thehighlandsgroup.us