How to print all session variables currently set?

后端 未结 7 2048
眼角桃花
眼角桃花 2020-12-12 18:56

Without having to call each session variable by name, is there a way to display the content of all the session variables currently set?

7条回答
  •  隐瞒了意图╮
    2020-12-12 19:26

    Echo the session object as json. I like json because I have a browser extension that nicely formats json.

    session_start();
    echo json_encode($_SESSION);
    

提交回复
热议问题