I have a website built in PHP by another developer who is no longer available for contact. The website was recently moved from Heart Internet to SiteGround, and I’m encountering an issue with PHP session variables.
Here’s the problem:
-
The front PHP file where HTML pages are rendered can access session variables without any issue.
-
However, in the backend PHP file that processes an API request, the session variables return
null
.
This issue only started after migrating the site to SiteGround. Before the migration, everything worked fine on Heart Internet.
Steps Taken:
-
Verified that
session_start()
is called at the beginning of both the front and backend PHP files. -
Checked that the session IDs in both the front and backend PHP files are the same.