douqiao2008 2015-04-01 21:16
浏览 37

会话保持活动状态,直到Wordpress仪表板中的页面更新为止

Something very strange is happening. I am using sessions on my wordpress website and for some reason, a session stays active until I update the page in the Wordpress website.

I have build a template for a login page and a page that will be reached after succesfully logging in. The following occurs:

  • First I have updated the pages in Wordpress
  • I log in as John and i reach the secure page with John's information.
  • I log out as John and log in as Pete, but i still see John's information. Even if i log in from a completely different pc. Also, if I directly go to the secure page, without logging in, I still see John's information!
  • I update the secure page again in Wordpress and all information on the secure page is gone again and I can log in normally again.

How is this possible? Why is the session information of one user stored on the page for everyone to see? And why does it only disappear when I update the page in the Wordpress dashboard?

If it would help, I can post my code.

code of secured page:

    <div id="primary">
        <div id="content" role="main">
            <?php
            session_start();
            $periodarray = array('januari', 'februari', 'maart', 'april', 'mei', 'juni', 'juli', 'augustus', 'september', 'oktober', 'november', 'december');
            if(date("d") > 10){$maand1 = date("m");}else{$maand1 = date("m") - 1;}
            if(isset($_GET['periode'])){$periode = $_GET['periode'];}else{$periode=$periodarray[$maand1-1];}
            if(isset($_GET['jaar'])){$jaar = $_GET['jaar'];}else{$jaar = date("Y");}
            if(isset($_SESSION['rhptarief'])){$rhptarief = $_SESSION['rhptarief'];}
            if (isset($_SESSION['username'])) 
            {
                $hdmsg = "Welkom ".$_SESSION['name'];?><body>


            <?php }else{?>
            <body>
            <div>
            U bent niet ingelogd.
            <input type="button" style="background-color:#F90;" value="Inloggen" onClick="LogIn()">
            </div>
            </body>
            <?php } ?>
        </div><!-- #content -->
    </div><!-- #primary -->

Edit: It only seems to be happening with Internet Explorer (I use 11) and not with Google Chrome.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 西门子S7-Graph,S7-300,梯形图
    • ¥50 用易语言http 访问不了网页
    • ¥50 safari浏览器fetch提交数据后数据丢失问题
    • ¥15 matlab不知道怎么改,求解答!!
    • ¥15 永磁直线电机的电流环pi调不出来
    • ¥15 用stata实现聚类的代码
    • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
    • ¥20 docker里部署springboot项目,访问不到扬声器
    • ¥15 netty整合springboot之后自动重连失效
    • ¥15 悬赏!微信开发者工具报错,求帮改