English 中文(简体)
PHP session_write_close()造成空洞反应
原标题:PHP session_write_close() causes empty response
  • 时间:2010-03-29 00:20:15
  •  标签:
  • php
  • session

在我手稿结尾的关闭功能中使用_write_close()时,PHP刚刚去世。 没有任何错误记录、反应头(火力)或数据(甚至白天!)被退回。 我完全有PHP错误报告,而PHP软件是能够做到的,PHP 5.2.1。

我的猜测是,自会议闭幕之后,人们就叫_“rite”——正遇到一些致命错误,即PHP坠毁,然后才有机会发送产出或记录任何东西。

这只是在原木页上发生,我首先:

...
    //If there is no session to delete (not started)
    if ( ! session_id())
    {
        return;
    }

    // Get the session name
    $name = session_name();

    // Delete the session cookie (if exists)
    if ( ! empty($_COOKIE[$name]))
    {
        //Get the current cookie config
        $params = session_get_cookie_params();

        // Delete the cookie from globals
        unset($_COOKIE[$name], $_SESSION);

        //Delete the cookie on the user_agent
        setcookie($name,   , time()-43200, $params[ path ], $params[ domain ], $params[ secure ]);
    }

    // Destroy the session
    session_destroy();
...

然后,2)在整页之后,再发布一个方向,4)最后发行了“<条码>登记_shutdown_Function()。 我安排了较早的运行,并打电话给数据库,使会议节省下来。 结束。

由于这一空白的答复只是出现在Im的 log缩中,我gues认为,Im不适当地重开本届会议,这正造成会议——即会议——在发言稿结尾处死亡。

最佳回答

Weird。 问题似乎是,在我撤除 co之前,我正在摧毁本届会议。

这项工作:

    // Delete the session cookie (if exists)
    if ( ! empty($_COOKIE[$name]))
    {
        //Get the current cookie config
        $params = session_get_cookie_params();

        // Delete the cookie from globals
        unset($_COOKIE[$name], $_SESSION);

        //Delete the cookie on the user_agent
        setcookie($name,   , time()-43200, $params[ path ], $params[ domain ], $params[ secure ]);
    }

    // Destroy the session -----------------------------------------
    session_destroy();

而此刻又一页:

    // Destroy the session -----------------------------------------
    session_destroy();

    // Delete the session cookie (if exists)
    if ( ! empty($_COOKIE[$name]))
    {
        //Get the current cookie config
        $params = session_get_cookie_params();

        // Delete the cookie from globals
        unset($_COOKIE[$name], $_SESSION);

        //Delete the cookie on the user_agent
        setcookie($name,   , time()-43200, $params[ path ], $params[ domain ], $params[ secure ]);
    }

谁知道为什么?

问题回答

暂无回答




相关问题
why the session in iis automatically log out?

I used iis6, and when i called a function Directory.delete(), the all the session relate this website will be logged out. and i debugged the website, i found no exception. any one have ideas on this ? ...

Check session from a view in CodeIgniter

What is the best way to check session from a view in CodeIgniter, it shows no way in their user guide, otherwise I will have to make two views on everything, which is kinda weird...still a newbie to ...

Can I get the size of a Session object in bytes in c#?

Is it possible to get the size(in bytes) of a Session object after storing something such as a datatable inside it? I want to get the size of a particular Session object, such as Session["table1"], ...

提供严格分类的出席会议物体

提供严格分类的与会机会的最佳方式是什么? 我正计划转而选择矩阵,这正在促使汇编者抱怨我的幻觉方案拟订方法......

PHP Session is not destroying after user logout

I m trying to create an authentication mechanism for my PHP Application and I m having difficulty destroying the session. I ve tried unsetting the authentication token which was previously set within ...

热门标签