在Firefox里登陆一些系统,然后关闭Firefox再重新打开,Firefox就会重新载入那个系统,但还是在线,不会提示重新登陆,这样不安全,但phpMyAdmin在Firefox登陆后,如果关闭了Firefox重新打开,载入phpMyAdmin时是要求重新登陆的,请教各位如何实现呢?

解决方案 »

  1.   

    设置用户名密码存放的cookie的过期时间为小于当前时间(用身份验证票的方式验证登陆)
      

  2.   

    我没用过COOKIE,平时只是用SESSION,是这样吗?
    test1.php
    <table>
    <form method="post" action="test2.php">
    <input type="text" name="urername">
    <input type="submit" value="提交">
    </form>
    </table>test2.php
    <?
      setcookie("username", $_POST["username"], time()+3600);
      echo "<script>location = "test3.php";</script>";
    ?>test3.php
    <?
      if (!empty($_COOKIE["username"]))
      {
        echo $_COOKIE["username"];
        echo "<a href='exit.php'>退出</a>";
      }
      else
      {
        echo "<script>location='test1.php';</script>";
      }
    ?>exit.php
    <?
      setcookie("username", "", time()-3600);
      echo "<script>location='test1.php';</script>";
    ?>
      

  3.   

    用SESSION的話,在FIREFOX裏打開隨便一個系統登陸後,再整個關閉FIREFOX,再打開,看一下那個系統是否會提示重新登陸。