<i id='hOpR9'><tr id='hOpR9'><dt id='hOpR9'><q id='hOpR9'><span id='hOpR9'><b id='hOpR9'><form id='hOpR9'><ins id='hOpR9'></ins><ul id='hOpR9'></ul><sub id='hOpR9'></sub></form><legend id='hOpR9'></legend><bdo id='hOpR9'><pre id='hOpR9'><center id='hOpR9'></center></pre></bdo></b><th id='hOpR9'></th></span></q></dt></tr></i><div id='hOpR9'><tfoot id='hOpR9'></tfoot><dl id='hOpR9'><fieldset id='hOpR9'></fieldset></dl></div>
    • <bdo id='hOpR9'></bdo><ul id='hOpR9'></ul>

    <tfoot id='hOpR9'></tfoot>

      <legend id='hOpR9'><style id='hOpR9'><dir id='hOpR9'><q id='hOpR9'></q></dir></style></legend>
    1. <small id='hOpR9'></small><noframes id='hOpR9'>

      标头后PHP会话被破坏/丢失

      PHP session destroyed / lost after header(标头后PHP会话被破坏/丢失)
    2. <legend id='IGztS'><style id='IGztS'><dir id='IGztS'><q id='IGztS'></q></dir></style></legend>
          <tbody id='IGztS'></tbody>

          <small id='IGztS'></small><noframes id='IGztS'>

            <bdo id='IGztS'></bdo><ul id='IGztS'></ul>
            <tfoot id='IGztS'></tfoot>
            1. <i id='IGztS'><tr id='IGztS'><dt id='IGztS'><q id='IGztS'><span id='IGztS'><b id='IGztS'><form id='IGztS'><ins id='IGztS'></ins><ul id='IGztS'></ul><sub id='IGztS'></sub></form><legend id='IGztS'></legend><bdo id='IGztS'><pre id='IGztS'><center id='IGztS'></center></pre></bdo></b><th id='IGztS'></th></span></q></dt></tr></i><div id='IGztS'><tfoot id='IGztS'></tfoot><dl id='IGztS'><fieldset id='IGztS'></fieldset></dl></div>
              • 本文介绍了标头后PHP会话被破坏/丢失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我有一个脚本,它在使用 header() 重定向到 / 之前设置一些会话值.

                I've got a script that sets some session values before redirecting to / using header().

                我已经阅读了很多关于 $_SESSION 变量在 header() 之后被破坏/丢失的帖子,即使在我实现了这个之后:

                I've read many posts about the $_SESSION variable being destroyed / lost after header(), even after I implemented this:

                // set session here
                
                session_regenerate_id(true);
                session_write_close();
                header("Location: /");
                

                session_start() 设置在正确的位置,有人知道我可能缺少什么吗?

                session_start() is set in the correct places, does anyone know of anything that I might be missing?

                在 index.php 页面上我有这个:

                On the index.php page I have this:

                session_start();
                print_r($_SESSION);
                
                // outputs nothing :'(
                

                代码非常复杂,所以不会全部发布,只是片段.

                The code is pretty complex so will not post it all, just snippets.

                推荐答案

                为了结束这个问题,我们得出的结论是服务器配置有问题,考虑到主机以这种事情而闻名,这并不奇怪.

                In the interest of closing this question, we had concluded it was a problem with the server configuration, not surprising considering the host is well known for this kind of thing.

                这篇关于标头后PHP会话被破坏/丢失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)

                        <small id='cD5o8'></small><noframes id='cD5o8'>

                          <tbody id='cD5o8'></tbody>
                        <legend id='cD5o8'><style id='cD5o8'><dir id='cD5o8'><q id='cD5o8'></q></dir></style></legend>
                          <bdo id='cD5o8'></bdo><ul id='cD5o8'></ul>
                          <tfoot id='cD5o8'></tfoot>
                          <i id='cD5o8'><tr id='cD5o8'><dt id='cD5o8'><q id='cD5o8'><span id='cD5o8'><b id='cD5o8'><form id='cD5o8'><ins id='cD5o8'></ins><ul id='cD5o8'></ul><sub id='cD5o8'></sub></form><legend id='cD5o8'></legend><bdo id='cD5o8'><pre id='cD5o8'><center id='cD5o8'></center></pre></bdo></b><th id='cD5o8'></th></span></q></dt></tr></i><div id='cD5o8'><tfoot id='cD5o8'></tfoot><dl id='cD5o8'><fieldset id='cD5o8'></fieldset></dl></div>