好,说清楚点
一个简单的用户登录页面,当用户登录后将登录名称和密码以及权限存为SESSION变量
程序在APACHE下正常执行,但到了IIS下面就不行了

解决方案 »

  1.   

    说的在清楚一点,就是在IIS下面SESSION变量可以注册但是提不出来,在TEMP里的session文件中有东西,但就是提不出来
      

  2.   

    在IIS下面,注册SESSION变量的时候生成了两个SESSION文件,一个为正常的一个为空的,我估计取SESSION变量的时候是取那个空的文件了,因为在APACHE下面注册SESSION变量的时候只生成一个文件.
        基本上情况就是这样的了.
       谢谢
      

  3.   

    使用phpinfo()看一下变量是否创建?
      

  4.   

    修改php.ini中关于Session的路径,必须是一个正确有效的路径.
      

  5.   

    SESSION的路径没问题,因为SESSION变量已经创建了,但是同时生成了两个SESSION文件,一个是正常的一个是空的,而且在下个页面读取的时候我怀疑是读取了那个空的文件了.
      

  6.   

    请贴出php.ini中关于session的部分
      

  7.   

    [Session]
    session.save_handler      = files   ; handler used to store/retrieve data
    session.save_path         = /tmp    ; argument passed to save_handler
                                        ; in the case of files, this is the
                                        ; path where data files are stored
    session.use_cookies       = 1       ; whether to use cookies
    session.name              = PHPSESSID  
                                        ; name of the session
                                        ; is used as cookie name
    session.auto_start        = 0       ; initialize session on request startup
    session.cookie_lifetime   = 0       ; lifetime in seconds of cookie
                                        ; or if 0, until browser is restarted
    session.cookie_path       = /       ; the path the cookie is valid for
    session.cookie_domain     =         ; the domain the cookie is valid for
    session.serialize_handler = php     ; handler used to serialize data
                                        ; php is the standard serializer of PHP
    session.gc_probability    = 1       ; percentual probability that the 
                                        ; 'garbage collection' process is started
                                        ; on every session initialization
    session.gc_maxlifetime    = 1440    ; after this number of seconds, stored
                                        ; data will be seen as 'garbage' and
                                        ; cleaned up by the gc process
    session.referer_check     =         ; check HTTP Referer to invalidate 
                                        ; externally stored URLs containing ids
    session.entropy_length    = 0       ; how many bytes to read from the file
    session.entropy_file      =         ; specified here to create the session id
    ; session.entropy_length    = 16
    ; session.entropy_file      = /dev/urandom
    session.cache_limiter     = nocache ; set to {nocache,private,public} to
                                        ; determine HTTP caching aspects
    session.cache_expire      = 180     ; document expires after n minutes
    session.use_trans_sid     = 1       ; use transient sid support if enabled