PHPSESSID returned from call - not the variable called

This code worked for years - it was written for PHP 5.xx. I cleaned it up for PHP 7 and it worked OK until last week it started returning the text PHPSESSID from an external random number php file. I double checked the code and it isn’t showing any errors on the online PHP 7 testing site.
When a PHP script wants to retrieve the value from a session variable, PHP automatically gets the unique session identifier string from the PHPSESSID cookie and then looks in its temporary directory for the file bearing that name and a validation can be done by comparing both values.

Does anyone have any idea why, this would fail and instead return the text PHPSESSID as the reply to a call for a number? Does that appear if the external php script fails? Or is there something wrong with the server installation temp file? The file otherwise works OK and reads and writes information to a SQL database.

Sounds like there is a typo. Without seeing some of the code, there’s no way to tell. Try turning on errors, and see if any error messages are displayed.

Actually it turned out to be simpler than a typo. I was uploading the files FTP using Filezilla and for some strange reason the file (only 84KB) was not uploading correctly. I finally noticed the discrepancy in file size and uploaded using the server’s file manager. The code worked fine after that.
No idea why Filezilla goofed, it’s been excellent with FTP uploads and it was just that one file that wouldn’t upload entirely.
I experimented a bit and tried uploading the same file to different folders and it always stopped uploading after uploading about 50% of the file.

Sponsor our Newsletter | Privacy Policy | Terms of Service