Welcome Guest, Not a member yet? Register   Sign In
Session doesn't save the data
#1

[eluser]Thibaut Rey[/eluser]
Hello,

Another problem for my website.

I try now to use the sessions. I use also the database to save the session. So in the database for one page i read at the browser i have one line that appears in the ci_session table is it normal ? Moreover i think that the system doesn't save my data.
Let me show you the code :

Code:
$this->session->set_userdata('id', $this->connexion->user_id($email));

// $this->connexion->user_id($email) return 19

echo $this->session->userdata('id');

If i print the value of the session on the same controller i don't have problem. But if i try to print the value on another controller the value doesn't exist (i think because the system create another line of session on the database)

This is an extract of my config.php file :

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

I'm a new developer and it's possible that i don't have understand something about session. Can you help me please.
#2

[eluser]cideveloper[/eluser]
What is the size of your user_agent field in the ci_session table? Increase it to 100. Also change user_data to MEDIUMTEXT.
#3

[eluser]Thibaut Rey[/eluser]
Same problem with this
#4

[eluser]Unknown[/eluser]
Load the session library in config file
#5

[eluser]osci[/eluser]
[quote author="Hello" date="1309435688"]Load the session library in config file[/quote]
As of v2.0.2 you don't load the session class
User Guide - Upgrading 2.0.1 to 2.0.2
#6

[eluser]Thibaut Rey[/eluser]
It is already do.
#7

[eluser]Thibaut Rey[/eluser]
I use now DB session and it done. But i'm very bored that the codeIgniter sessions have problem.
#8

[eluser]osci[/eluser]
When you are talking about db session you mean you have enabled sess_use_database? This is ci session.
About my comment on upgrade sorry, it was about the security not session, so wrong post.

I noticed that there is a check for ip. I don't know if it works nice if you are behind a proxy.
Also ie doesn't like very much underscores in cookie names.
#9

[eluser]Thibaut Rey[/eluser]
I have a mac and so i use safari and firefox. I say that i use now this : http://codeigniter.com/wiki/DB_Session/

I think the codeigniter session system isn't stable.

But DB session is stable and done very well.
#10

[eluser]InsiteFX[/eluser]
Oh really! I have no problems using CI Sessions.

InsiteFX




Theme © iAndrew 2016 - Forum software by © MyBB