AJAX request fails to process $_SESSION variable

后端 未结 1 1624
攒了一身酷
攒了一身酷 2021-01-28 02:10

I have a JavaScript file that processes an AJAX request. This request processes a PHP file (which works fine). But when I want to call in this very PHP file my $_SESSION

相关标签:
1条回答
  • 2021-01-28 02:25

    Add this to your ajax .php file

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

    Ideally, you would have that in some common config file...

    0 讨论(0)
提交回复
热议问题