Session with objects
Posted: Tue Apr 29, 2003 3:46 pm
I had experienced some troubbles setting an object in a variable session. I tried to do:
page1.php
<?php
session_start();
$arbitrer = new COM("Arbitrer.1") or die("I can't create Arbitrer");
$rc = $arbitrer->Logon( $_REQUEST ["name"], $_REQUEST ["password"], $var );
if ( $rc != 0 ){
// function error
...
}
$_SESSION['arbitrer'] = $arbitrer;
header("Location: page2.php");
// That's work right
------------------------------------
page2.php
<?php
session_start();
if ( is_null( $_SESSION['arbitrer'] ) ) {
print "I can't get arbitrer";
}
//Always print the message because abitrer is null
What am i doing wrong??? Anyone has any idea??? I'm driving crazy with this problem!!!
page1.php
<?php
session_start();
$arbitrer = new COM("Arbitrer.1") or die("I can't create Arbitrer");
$rc = $arbitrer->Logon( $_REQUEST ["name"], $_REQUEST ["password"], $var );
if ( $rc != 0 ){
// function error
...
}
$_SESSION['arbitrer'] = $arbitrer;
header("Location: page2.php");
// That's work right
------------------------------------
page2.php
<?php
session_start();
if ( is_null( $_SESSION['arbitrer'] ) ) {
print "I can't get arbitrer";
}
//Always print the message because abitrer is null
What am i doing wrong??? Anyone has any idea??? I'm driving crazy with this problem!!!