Welcome Guest, Not a member yet? Register   Sign In
How to add session item as a property of $this->session?
#1

In documentation we can find 3 ways to add session data.
  • By $_SESSION array (undescribed how to do it, but this actually is well known from php's)
  • As a property of $this->session (undescribed...)
  • By userdata old method (described)

Old method described and other 2 not?...

And question is.
How to add session data as a property of $this->session
And not old method of assigning it as userdata



[Image: 0K0t9we.jpg]
Reply
#2

The documentation assumes you know PHP, as you should.
Learn what a property is, and you'll know how to do it.
Reply
#3

You just set the data you want to store like this:
$this->session->user_name="ABC";
$this->session->user_id="123";

You can then retrieve the data with echo $this->session->user_name;

But as Narf pointed out, If you dont even understand these basic PHP things you really should learn PHP first before diving into CI
On the package it said needs Windows 7 or better. So I installed Linux.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB