avoid go back after logout

后端 未结 2 1239
礼貌的吻别
礼貌的吻别 2021-01-25 15:51

i found these questions, where the op has the same problem than me.

1 2

However, i can\'t solve my problem. The user press logout button, then the page is redi

2条回答
  •  半阙折子戏
    2021-01-25 16:22

    you can try the following: create a session table where you store a session_id. when a user logs in, you create a session_id and store session id in the $_SESSION. every page you load, first you check if the session_id is available in the database. if not you go to the logging page. otherwise you load page and at the time of logout you delete session_id from database.

    even though you can use the backbutton to go back no operation will be possible. you can also make the page non-cachable

提交回复
热议问题