PHP session HTTP to HTTPS problem

后端 未结 2 634
我寻月下人不归
我寻月下人不归 2020-12-16 17:23

I have a (HTTPS) login.php page which remains HTTPS (ie once user logged in goes to account dashboard). Now the problem is say the user whilst logged on to the secure dashbo

2条回答
  •  青春惊慌失措
    2020-12-16 17:56

    The description by @rickchristie is good, but I think there's a better solution that he doesn't suggest. If you don't always want to use HTTPS (which does make sense sometimes; the about_us page doesn't need to be secure), you can follow the advice on the session_start page and use named sessions to continue a previous session. This is simple to use; just include the session_start calls with

    session_name("MySession"); // replace with whatever makes sense
    session_start();
    

    on all secure pages.

提交回复
热议问题