Session lost after page redirect in php

前端 未结 7 1367
你的背包
你的背包 2020-11-30 13:52

When I use php header redirection all session variables are lost... Some people say that adding exit(); just after the header(\"\"); will solve the problem but it doesn\'t s

7条回答
  •  天命终不由人
    2020-11-30 14:49

    I was trying to set the session id of my own using :

    session_id('own_generated_session_id_string');
    

    But as the documentation says, you have to use this before

    session_start();
    

    Using it after session_start(), clears the session parameters.

提交回复
热议问题