Following code:
?php
class SessionTestC {
protected $value;
function __construct ( $val ) {
$this-value = $val;
}
function GetValue () {
return $this-value;
}
}
if ( isset ($_SESSION['TestObj'])) {
echo 'Session Test is set to:
Thomas Munz wrote:
I think, its not possible to init an Objeect on a session.
Yes, it can.
The problem was with serialization. With session.auto_start set to 1 on
php.ini, seems like session's objects are unserialized before loading
the script, so the class is not loaded when the session
I think, its not possible to init an Objeect on a session. Session will be
rebuild on each reload of the site based on the session id, i think...
Maybe here the object can't be rebuild anymore...
Following code:
?php
class SessionTestC {
protected $value;
function __construct (
Hi there, needing some more advise, is this function correct ?
function create_object($class_name,$dir = null, $serialize = null)
{
$dir ? $dir = $dir./ : $dir = ;
require_once(.CLASS_PATH.$dir.$class_name..php);
if
If you register an object as a session variable, do you need to include the
objects class *before* start_session()?
What if I use serialize() on my object, and then register a variable with
the serialized data; then I can start_session(), do some other things, then
include the class definition,
On Monday 26 November 2001 23:37, Christopher William Wesley wrote:
On Mon, 26 Nov 2001, Greg Sidelinger wrote:
Can someone tell me how to store a class in a session var. I
want to
There are several things you need to do.
1) include the class definition before you do anything
2) start
Can someone tell me how to store a class in a session var. I want to
test to see if it has been defined and if not create it. I'm having
problems with it right now.
This is what I'm trying currently
?
Class a
{
var $temp;
function a()
{
later on I get errors about the class functions being undefined.
Can anyone please point me in the right direction on how to
register my objects as session vars.
Class definition *must* be before any session_start() or
sessgion_register() if there are previously stored objects in the
On Mon, 26 Nov 2001, Greg Sidelinger wrote:
Can someone tell me how to store a class in a session var. I want to
There are several things you need to do.
1) include the class definition before you do anything
2) start the session shortly thereafter
3) register a session variable
4) create
On Tue, 3 Jul 2001 11:47, Ethan Schroeder wrote:
If what you mean is if PHP sessions can register objects, that is true and
quite effective.
Can you elaborate on this Ethan so I'm sure I understand what you're saying.
Cheers,
Brad
--
PHP General Mailing List (http://www.php.net
Hello,
I was informed by someone that is a blatent liar and regulary makes
things up that PHP session can handle Objects. Is this true?
Thank you,
Brandon Orther
If what you mean is if PHP sessions can register objects, that is true and
quite effective.
Ethan Schroeder
- Original Message -
From: Brandon Orther [EMAIL PROTECTED]
To: PHP User Group [EMAIL PROTECTED]
Sent: Monday, July 02, 2001 4:36 PM
Subject: [PHP] Objects and sessions
Hello
12 matches
Mail list logo