开发者

$_SESSION is empty in another page

开发者 https://www.devze.com 2023-04-12 08:21 出处:网络
I have a HTML page (h1.html) which submits a form to a PHP page (p1.php) via an AJAX call. In p1.php I have:

I have a HTML page (h1.html) which submits a form to a PHP page (p1.php) via an AJAX call. In p1.php I have:

session_start();
$_SESSION['sth'] = "some value";开发者_JS百科
// some other stuff here

Then I submit another form in h1.html in another PHP page (p2.php) without using AJAX.

The problem is $_SESSION is empty in p2.php! I call session_start() in both p1 and p2.

Any suggestion?

0

精彩评论

暂无评论...
验证码 换一张
取 消