search

Home  >  Q&A  >  body text

Can't the php file get the value in the session of another php file? What's going on?

session 安全内容

session_start();

$yb_userid = $_SESSION['yb_userid'];

var_dump($yb_userid) ;


小亮小亮2050 days ago1485

reply all(5)I'll reply

  • Alone88

    Alone882019-05-10 10:33:05

    Is the session enabled on another page, or is there a typo...

    reply
    0
  • 小亮

    If it is enabled, after I obtain the desired data through the third-party website interface, I add the data to the session to facilitate subsequent verification. Then I can obtain the session content value on this page, but other files cannot obtain these. Yes, I tested it again and found that the session content saved in other files can be obtained. Do you know the reason for this?

    小亮 · 2019-05-10 10:35:58
  • Single

    Single2019-05-09 16:57:29

    Can you get your settings?

    reply
    0
  • 小亮

    That is, after I initiate a session on one page, another page cannot go to the specified session and the generated sessionid is different. I want to know if this is related to the configuration.

    小亮 · 2019-05-09 17:10:00
  • 孤独で寂しい。

    孤独で寂しい。2019-05-08 21:37:33

    $a = session(''); Try this

    reply
    0
  • Cancelreply