Issue with the casting of a SESSION variable
- From: AndreH <ahaupt@xxxxxxxxx>
- Date: Wed, 29 Oct 2008 04:00:22 -0700 (PDT)
Good day,
I have the a bit of an issue with retrieving an object from php's
session.
I set a session variable "user" from the class User as follows:
$user = new User();
// ... do some stuff to $user
$_SESSION['user'] = serialize($user);
And try to retrieve the variable again later:
$user=(User)unserialize($_SESSION['user']);
But the last statement throws this error:
Parse error: syntax error, unexpected T_STRING in ...
Google did not produce any useful solutions to this problem; Other
than syntax issues, but I'm 100% sure it is not an earlier syntax
issue. The problem lies in the casting of session object.
Any help would be appreciated.
Regards,
Andre
.
- Follow-Ups:
- Re: Issue with the casting of a SESSION variable
- From: Rzzap
- Re: Issue with the casting of a SESSION variable
- From: Suhas Dhoke
- Re: Issue with the casting of a SESSION variable
- Prev by Date: Re: Password previously used ideas?
- Next by Date: Re: Issue with the casting of a SESSION variable
- Previous by thread: Password previously used ideas?
- Next by thread: Re: Issue with the casting of a SESSION variable
- Index(es):
Relevant Pages
|