Session lost after page redirect in php

前端 未结 7 1385
你的背包
你的背包 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:38

    You need to put exit(); after your header redirection, otherwise you have just loaded two pages of content into 1 page.

    Also make sure you have session_start(); at the top of all your scripts.

提交回复
热议问题