Jump to content

session variable between pages


Doc
 Share

Recommended Posts

Hi guys,

I've just created a new user :

                $u = new User();
                $u->name = $nickname;
                $u->pass = $pwd;
                $u->addRole("guest");
                $u->save();

I've added some new informations on that user, here :

$u->points = 3;

$u->language = 'fr';

Now I'm doing my session->login stuff, and my session->redirect stuff.

On the destination page, I thought I would retrieve the $u->points and $u->language values, but it's not set.

I thought I was saving the values in my news user's session area but I'm apparently wrong.

I guess I have to use that syntax in the first page :

$session->points = 3;

$session->language = 'fr';

... and then it will be still there on the destination page ? Is it the good way to do it ? Do my values will stick with the right user I'm dealing with ?

Thanks

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...