|
发表于 2009-4-15 15:04:44
|
显示全部楼层
$this->load->helper('cookie');
ci读取cookie
$username = get_cookie('cookie_name');
写入cookie
$cookie = array(
'username' => 'username',
'Domain' => 'localhost',
'path' => '/'
);
set_cookie($cookie);
session
$this->load->library('session');
$this->session->userdata('username');
读取session
$session_data = array(
'username' => 'username'
)
$this->session->set_userdata($session_data);
所用ci版本为1.7 |
|