[eluser]chmod[/eluser]
Thanks to iainco. you are right.although I saved the session_id before,but he session updated, and CI's method gc deleted it.so I can't acess it.so, I resolved this problem:
Edit the config.php:
Step 1:
Code:
$config['sess_cookie_name'] = 'ci_session';
$config['sess_expiration'] = 300;
$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;
Step 2:
decide gc:
$config['sess_probability'] = 25;
Step 3:
edit lib's Session.php
change:
Code:
if ((rand() % 100) < $this->gc_probability)
to
Code:
if ((rand() % $this->CI->config->item('sess_probability')) < $this->gc_probability)
Step 4:
change:
Code:
setcookie(
$this->sess_cookie_name,
$cookie_data,
$this->sess_expiration + time(),
$this->cookie_path,
$this->cookie_domain,
0
);
to
Code:
setcookie(
$this->sess_cookie_name,
$cookie_data,
0,
//$this->sess_expiration + time(),
$this->cookie_path,
$this->cookie_domain,
0
);
all these code resolved three things:
1:when I close browser's windows,the cookie will be delete.
2:CI's gc will work by myself;
3
ession will not regen in short time.