一、session:

  1. 声明:
    session_start();
  2. 设置:
    $_SESSION['name']  =  'value';
  3. 获取:
    $_SESSION['name'];
  4. 删除单个:
    unset($_SESSION['name']);
  5. 销毁全部:
    session_destroy();

    二、cookie:

  6. 设置:
    setcookie('name','value');
  7. 获取:
    $_COOKIE['name'];
  8. 删除单个:
    setcookie('name',null);
  9. 销毁全部:
    foreach($_COOKIE  as  $k=>$v){
    setcookie($_COOKIE[$k],null);
    }