hi i am using codeigniter .
i know the size of session is 4kb.
i want to get the current session usage in my site ,
i am looking for a function like like get_session_c开发者_JS百科urrent_usage() (this is created by me ;))
instead of Saving Session Data to a Database . i would like to get my current session usage and if it is near 4kb , i want to destroy it . please help.................
if you store the session in a plain cookie, the classic way of codeigniter just read the raw cookie and check the length of the cookie:
$cookie = $_COOKIE['your_session_name'];
$cookieSize = strlen($cookie);
if($cookieSize > $CookieSizeLimit) {
// do something
}
Why do you want to destroy the cookie after a set size? just curious
加载中,请稍侯......
精彩评论