Welcome Guest, Not a member yet? Register   Sign In
Session is created everytime I refresh my browser.
#1

[eluser]jpganz[/eluser]
Hi!

I am trying to use session on codeigniter but I am getting an error, everytime I refresh my page seems like CI creates another session, and of course I cant save my info.

Any idea why is this? how could I solve it?

My code is this

Code:
$this->load->library('session');
print_r  ($this->session->all_userdata());

And my configuration (because I read this could cause the problem) is this

Code:
$config['sess_cookie_name'] = 'site';
$config['sess_expiration']  = 3600;
$config['sess_expire_on_close'] = FALSE;
$config['sess_encrypt_cookie'] = FALSE;
$config['sess_use_database'] = FALSE;
$config['sess_table_name']  = 'session';
$config['sess_match_ip']  = FALSE;
$config['sess_match_useragent'] = TRUE;
$config['sess_time_to_update'] = 300;

/*
|--------------------------------------------------------------------------
| Cookie Related Variables
|--------------------------------------------------------------------------
|
| 'cookie_prefix' = Set a prefix if you need to avoid collisions
| 'cookie_domain' = Set to .your-domain.com for site-wide cookies
| 'cookie_path'   =  Typically will be a forward slash
| 'cookie_secure' =  Cookies will only be set if a secure HTTPS connection exists.
|
*/
$config['cookie_prefix'] = "site";
$config['cookie_domain'] = "http://localhost/";
$config['cookie_path']  = "/";
$config['cookie_secure'] = FALSE;

Any help would be greatful appreciated.


Messages In This Thread
Session is created everytime I refresh my browser. - by El Forum - 07-10-2012, 10:10 AM
Session is created everytime I refresh my browser. - by El Forum - 07-11-2012, 02:06 AM



Theme © iAndrew 2016 - Forum software by © MyBB