From experience, I can tell you a few things.
First you need to start sessions with
session_start();
At the top of each page you want to use sessions.
Then, to save the session data, you need to call another function to tell php that you are saving the saved data. This function
Session_write_close();
This feature is needed at the bottom of the page when you are finished writing data to the session and want to save it for future use.
With these two combinations, which should allow you to correctly record on the session, save the data that you entered into it, and access it later on your website.
Good luck.
source share