PHP $_SESSION doesn't work - "undefined array key" error [closed]

1 week ago 9
ARTICLE AD BOX

I have a project with several pages, and on the login page, when a user successfully logs in, the project stores the user's information in

session_start(); $_SESSION['IDUser'] = $IDUser; $_SESSION['email'] = $Email;

In Mainpage then i use:

session_start(); $UserID=$_SESSION['IDUser']; $UserEmai=$_SESSION['email'];

Then i need to export data in to excel and i need to export the info in $_SESSION['IDUser'];

in that new php file i use:

session_start(); $UserID=$_SESSION['IDUser']; $UserEmai=$_SESSION['email'];

but rise error "undefined array key "IDUser"

It seems there is no $_Session set!

Read Entire Article