note 35728 deleted from ref.session by didou
| From: | didou@php.net | Date: | Fri, 12 Sep 2003 12:12:29 +0000 |
| Subject: | note 35728 deleted from ref.session by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-56369@lists.php.net to get a copy of this message | ||
Note Submitter: Gareth Heyes
----
I thought this might be of some help to someone as I could not find the answer anywhere.
If you want to store an object in a session (from a class) using php 4.06 (Many ISPs use this as a
production server).
You must do this :-
class Shopping Carte {
function saveCarte() {
global $HTTP_SESSION_VARS;
global $shoppingCarte;
$shoppingCarte=serialize($this);
session_register("shoppingCarte");
}
}
Not this (Doesn't work in php 4.06):-
class Shopping Carte {
function saveCarte() {
global $HTTP_SESSION_VARS;
$shoppingCarte=serialize($this);
$HTTP_SESSION_VARS['shoppingCarte'];
}
}