不知道楼主想问的是什么意思~~
$_SESSION["..."]="..."不就可以?

解决方案 »

  1.   

    我是指彻底写入文件,默认是教本执行完毕才写入的。
    $_SESSION["..."]="..."不就可以?
    这个只是赋值,并未写入文件
      

  2.   

    谁说$_SESSION["..."]="..."不写入文件啊,
    不写入吗,不是吧。
    我觉得用这个就可以的。
      

  3.   

    我看手册上那段意思好象是如果不关闭就不能写入文件~~~因为有一个锁定的问题~~~
    楼主看看这样能行不~$_SESSION["temp"] = "temp";
    $temp = $_SESSION["temp"];
    session_write_close();
    session_start();
    $_SESSION["temp"] = $temp;不过好象没这个必要~~~
    Session data is usually stored after your script terminated without the need to call session_write_close(), but as session data is locked to prevent concurrent writes only one script may operate on a session at any time. When using framesets together with sessions you will experience the frames loading one by one due to this locking. You can reduce the time needed to load all the frames by ending the session as soon as all changes to session variables are done. 引入这个函数似乎是为了加快程序~~~
      

  4.   

    就是我也觉得$_SESSION["..."]的方式好用。可能不了解,可是这样真的简化了不少。
      

  5.   

    我用自己重写session实现了,就是直接在程序中调用write($sid,session_encode());mikespook(Mike大懒猫) :你的方法不太合适,因为如果页面已有输出的话,session_start()就会报错。我之所以要在关闭页面前写入session数据到文件,因为我是要和CGI程序整合。共用一个session。目前已经实现了,谢谢各位!