How do i check if session_start has been entered?

前端 未结 10 1534
走了就别回头了
走了就别回头了 2020-12-09 09:00

I have a third party script and was wondering how I can check with PHP if session_start() has been declared before doing something?



        
10条回答
  •  隐瞒了意图╮
    2020-12-09 10:00

    if(!isset($_SESSION)) {
         session_start();
    }
    

    The check will allow you to keep your current session active even if it's a loop back submission application where you plan to reuse the form if data is typed incorrectly or have additional checks and balances within your program before proceeding to the next program.

提交回复
热议问题