Welcome Guest, Not a member yet? Register   Sign In
Writing custom session data to database
#1

[eluser]Unknown[/eluser]
I am trying to write custom session data to a database.

I have enabled database session logging in the database and setup the ci_session table in my db...

$config['sess_use_database'] = TRUE;

--

I am attempting to add custom data using an array, as described in the user guide...

Code:
$newdata = array(
                           'trip_id'  => $trip_id,
                           'quanity'     => '1'
                        );

        $this->session->set_userdata($newdata);

...but only the default session data in being written to the database.

Any ideas or steps I am missing?

Thanks,
#2

[eluser]mironcho[/eluser]
Hi Adam,
sess_use_database option enables storing of client session info (IP, UA, etc) to database, so session integrity and validity can be verified on the following requests with stored information. You can check this wiki page:

http://codeigniter.com/wiki/Category:Lib...:Session/

for more info about other possible session solutions




Theme © iAndrew 2016 - Forum software by © MyBB