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