Zen Cart Logo
Forums / Bug Reports / [Done v1.3.8] var declaration in sessions.php

[Done v1.3.8] var declaration in sessions.php

Locked

Views: 1,602

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
25 Aug 2007, 3:09 PM
#1
nesredep avatar

nesredep

New Zenner

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

[Done v1.3.8] var declaration in sessions.php

I downloaded 1.3.7 and found an error in sessions.php.

That is, admin/includes/classes/sessions.php

According to the PHP manual, only constant initializers for var variables are allowed. To initialize variables with non-constant values, you need to use the constructor function.

Specifically, in class php3session, the var declaration for $cookie_path should be changed to:

var $cookie_path;

and this line should be added to the php3session function:

$this->cookie_path = substr(DIR_WS_ADMIN, 0, -1);

At least, I believe this is a coding error, and if I'm wrong I apologize for troubling you.

John

25 Aug 2007, 4:16 PM
#2
drbyte avatar

drbyte

Sensei

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

Re: [Done v1.3.8] var declaration in sessions.php

nesredep:

I downloaded 1.3.7 and found an error in sessions.php.

That is, admin/includes/classes/sessions.phpJohn,
You're absolutely right ... that is bad code.

That's why that file is actually not used by Zen Cart.

Thanks for reminding us to remove the obsolete file.

The "real" file for handling sessions in v1.3.x is /includes/functions/sessions.php, shared by admin and catalog code.