简体   繁体   中英

PHP session is not working with Firefox

This happens only when I'm logging through with Firefox, what is the reason for that and how can I make this session working in Firefox?

    <?php
    session_start();

    $username=$_SESSION["username"];

    $sql="select * from person where username ='".$username."'";

Your problem seems related to Cache.

Use below headers to remove cache issue. add it after session_start() .

header("Cache-Control: no-cache");
header("Pragma: no-cache");

Hope it will help you :-)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM