Destroy PHP Session on closing

前端 未结 5 1658
一生所求
一生所求 2020-11-27 06:35

I have created a simple login page which is based on the sessions.

session_start();

and added a logout page that contains this



        
5条回答
  •  一向
    一向 (楼主)
    2020-11-27 07:28

    if you use:

    session_set_cookie_params(0);
    session_start();
    

    Your session cookie will destroy when the browser is closed... so your session will be good until they close the browser. IE. You login, and you are logged in, you close the browser, re-open it, go to the site again, and you wont be logged in.

提交回复
热议问题