- A long long time ago to learn CodeIgniter notes, very casual, but all of their own records, I hope that the people who need help.
- This article uses word2013 to edit and publish
- Postbird | There I am, in the world more exciting!
- Postbird Personal website:http://www.ptbird.cn
Session
The session in CI is in the presence of a cookie
1. Storage of Session data
$this->session->set_userdata (' user ', $user);
???? User is key
???? $data is a value
2, do not get the data just set
???? Only after the page reloads, jump to another controller or URL to get
3. Error handling
???? The order to use the Session class is required to set a encryption key in your config file.
???? To configure
???? 1) generate a random, non-repeating string echo MD5 (UNIQID ());
???? 2) Modify the configuration file $config [' Encryption_key ']
?
4. Configuration
?
where $config [' Sess_encrypt_cookie ']???? = TRUE adds another layer of encryption
?
5. Flash Data/Disposable data
???? Can only be read once
????
It's gone again.
????
CodeIgniter Getting Started learning notes 12-session actions