1、session_encode
session_encode将当前会话数据编码成为一个字符串,返回一个序列化后的字符串
string session_encode( void );
session_start();
$_SESSION['login_ok'] = true;
$_SESSION['nome'] = 'sica';
$_SESSION['inteiro'] = 34;
echo session_encode(); // 输出: login_ok|b:1;nome|s:4:"sica";inteiro|i:34
2、session_start()
3、session_save_path()
string session_save_path ([ string $path ] )
获取或者修改session保存的路径
4、session_id()
string session_id ([ string $id ] )
获取或者修改当前session的id值
5、session_name()
<?php
/* set the session name to WebsiteID */
$previous_name = session_name("WebsiteID");
echo "The previous session name was $previous_name<br />";
?>
6、session_destory()
销毁所有session。
7、session_decode()
bool session_decode ( string $data )
<?php
// if session is not started
session_start();
// store our current session
$my_sess = $_SESSION;
// decode $data (the encoded session data, either from a file or database). Remember, decoded data is put directly into $_SESSION
session_decode($data);
$data = $_SESSION;
print_r($data);
// restore our own session
$_SESSION = $my_sess;
?>
8、session_cache_limiter()和session_cache_expire()
<?php
/* set the cache limiter to 'private' */
session_cache_limiter('private');
$cache_limiter = session_cache_limiter();
/* set the cache expire to 30 minutes */
session_cache_expire(30);
$cache_expire = session_cache_expire();
/* start the session */
session_start();
echo "The cache limiter is now set to $cache_limiter<br />";
echo "The cached session pages expire after $cache_expire minutes";
?>