在login.php中
session_start();
session_register("sess_id");
$sess_id= "my name is zhouf";后试试
ehco $_SESSION['sess_id'];
看有没有输出?

解决方案 »

  1.   

    输出为my name is zhouf
      

  2.   


    在manageuerinfo.php中
    session_start();
    echo "sess_id=".$_POST['sess_id'];
    有结果吗?还有manageuerinfo.php要在login.php窗口中打开.
      

  3.   

    我的能行啊?
    1。register_globals改成on试一下;
    2。用$_SESSION['sess_id']访问.
      

  4.   

    没有结果
    但是manageuerinfo.php不是直接在login.php中打开的
    而是在login_lib.php中通过
    <script language="JavaScript"> 
        location.href="manageuserinfo.php";
    </script>
    打开的
      

  5.   

    没有结果
    但是manageuerinfo.php不是直接在login.php中打开的
    而是在login_lib.php中通过
    <script language="JavaScript"> 
        location.href="manageuserinfo.php";
    </script>
    打开的
      

  6.   

    分特,打错了,是$_SESSION['sess_id'],不好意思
      

  7.   

    你login_lib.php是从login.php中打开的就行了。
      

  8.   

    我的三个文件之间的关系为
    login.php->login_lib.php->manageuserinfo.php
      

  9.   

    还是没有结果
    login.php页面中
    session_start();
    echo session_id();
    在manageuserinfo.php页面中
    session_start();
    echo session_id();
    打印的值不一样
      

  10.   

    你把manageuserinfo.php中的session_start();放到login_lib.php的头部
    echo $_SESSION['sess_id']这一句放到manageuserinfo.php中,去掉manageuserinfo.php的session_start();
      

  11.   

    在login_lib.php

    session_start();
    echo "sess_id =".$_SESSION['sess_id'];打印的值为
    sess_id =$sess_id 的值未传到login_lib.php中
      

  12.   

    已经是on了
    是否和php.ini中其他的session值的设置有关?
    能否将php.ini中的session的设置的值列出来
    让我看一下是否是我的设置问题
    我的是
    [Session]
    ; Handler used to store/retrieve data.
    session.save_handler = files; Argument passed to save_handler.  In the case of files, this is the path
    ; where data files are stored. Note: Windows users have to change this 
    ; variable in order to use PHP's session functions.
    session.save_path = /tmp; Whether to use cookies.
    session.use_cookies = 1
    ; Name of the session (used as cookie name).
    session.name = PHPSESSID; Initialize session on request startup.
    session.auto_start = 1 ; Lifetime in seconds of cookie or, if 0, until browser is restarted.
    session.cookie_lifetime = 0; The path for which the cookie is valid.
    session.cookie_path = /; The domain for which the cookie is valid.
    session.cookie_domain =; Handler used to serialize data.  php is the standard serializer of PHP.
    session.serialize_handler = php; Percentual probability that the 'garbage collection' process is started
    ; on every session initialization.
    session.gc_probability = 1; After this number of seconds, stored data will be seen as 'garbage' and
    ; cleaned up by the garbage collection process.
    session.gc_maxlifetime = 1440; Check HTTP Referer to invalidate externally stored URLs containing ids.
    session.referer_check = 0; How many bytes to read from the file.
    session.entropy_length = 0; Specified here to create the session id.
    session.entropy_file =;session.entropy_length = 16;session.entropy_file = /dev/urandom; Set to {nocache,private,public} to determine HTTP caching aspects.
    session.cache_limiter = nocache ; Document expires after n minutes.
    session.cache_expire =  ; use transient sid support if enabled by compiling with --enable-trans-sid.
    session.use_trans_sid = 1url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry"
      

  13.   

    session  (通过phpinfo)
    Directive               Local Value   Master Value 
    session.auto_start         Off        Off 
    session.cache_expire      180        180 
    session.cache_limiter     nocache      nocache 
    session.cookie_domain      no value     no value 
    session.cookie_lifetime     0            0 
    session.cookie_path         /             / 
    session.cookie_secure      Off              Off
    session.entropy_file       no value     no value 
    session.entropy_length     0              0 
    session.gc_maxlifetime     1440           1440 
    session.gc_probability      1              1 
    session.name               PHPSESSID     PHPSESSID 
    session.referer_check       no value    no value 
    session.save_handler        files       files 
    session.save_path             /tmp       /tmp 
    session.serialize_handler     php         php 
    session.use_cookies           On          On 
    session.use_trans_sid         1            1 
      

  14.   

    如果我的
    sesson.cache_limiter = 180
    的话
    客户端的叶面不能得到及时的刷新,他总是将IE临时文件夹中的信息再次调用
    而不是我更新过的叶面。
    别的设置没有什么差别
      

  15.   

    如果sesson.cache_limiter = 180
    IE临时文件夹中显示的访问过的页面的截止期为
    第一次访问的时间+3小时
    我的页面就得不到及时的更新,
    而其他的不是我服务器上的页面的截止期显示为 无
      

  16.   

    只有在程序中实现了,上www.google.com上去搜一下有关php cache的能得到你想要的答案,
      

  17.   

    非常感谢xizi2002(戏子)和 teaps(teaps)
      

  18.   

    session_save_path("文件夹");加这句话试试!
    session_start();
    session_register("sess_id");
    $sess_id= "my name is zhouf";
      

  19.   

    还有,你的php.ini中的session.save_path = /tmp这个路径得改一下,改成如:c:/php/session,当然c:/php/session这个目录必须存在.