Welcome Guest, Not a member yet? Register   Sign In
[SOLVED] Session won't save my data
#1

[eluser]kroguz[/eluser]
After updating my session class with this one, my previous was solved, but now a new error occurred.

http://ellislab.com/forums/viewthread/13...15/#811009

The problem is that I can't store data into my database table 'user_data'. I tried using
$this->session->set_userdata('user_data', $userdata); and then I also tried
to log the result using $this->session->userdata('userdata); into the
firebug console but nothing was returned and nothing was added to the session
cookie nor the session database. Do you guys have any idea where the problem
could be?

I would like to add the class, but it's somehow too long....

Here are my configs:
Code:
config['sess_cookie_name']        = 'ci_session';
$config['sess_expiration']        = 7200;
$config['sess_expire_on_close']    = FALSE;
$config['sess_encrypt_cookie']    = FALSE;
$config['sess_use_database']    = TRUE;
$config['sess_table_name']        = 'ci_sessions';
$config['sess_match_ip']        = FALSE;
$config['sess_match_useragent']    = TRUE;
$config['sess_time_to_update']    = 300;
#2

[eluser]WanWizard[/eluser]
You've read the gotcha's when using my replacement library?

One of which is that it doesn't write the session automatically, but you'll have to do that implicitly?
#3

[eluser]kroguz[/eluser]
DAMMMMMMMMMMMMMMMMMMMMNNNNNNNNNNNITTTTTTTTTTTTTTT

THANK YOU VERY MUCH WANWIZARD..............YOU ARE THE BESSSSSST!!!!!!!!! I didn't read the captcha, but now that you mentioned it, i went to the session class and changed the parameter od sess_write...now it works...thanks.........

PS: i'll do some tests to see if it really works and write the result here......


EDIT: Yeah....I somehow didn't find any bug......i tried logging out and logging in again and everything seems fine....Dude you're just great. thanks again
#4

[eluser]WanWizard[/eluser]
If you change the parameter, you negate some of the libraries functionality.

The issue with CI's current implementation is that every change of the session results in a database operation. If you are, like me, a heavy session user, you'll end up with dozens of UPDATE's, which can have quite an impact on your total page processing time, and on your database load.

That's why my apps do an implicit $this->session->write(TRUE) at the end of every page request, and before a redirect(), for which I use an extended helper.




Theme © iAndrew 2016 - Forum software by © MyBB