In CodeIgniter, which function will be used to destroy the pre define sessio开发者_开发技巧n variable(id, username) after specified time i.e. 20sec?
Ther is no specific function for that, but in ci/root/application/config/config.php
around line 244 $config['sess_expiration'] = 7200;
this sets your session length.
Please notice that codegniter sessions are stored in cookies.
If you want to destroy a session after n
seconds i recommend you to use something else, like:
- Memcached
- ini_set("session.gc_maxlifetime", SESSION_LIFETIME_IN_SECONDS)
精彩评论