I have an old website, that is not on Wappler yet, sadly. i need to make a few changes and need to use a session variable to pass information from page to page, and for the life of me i can not get it to work, but it should.
Yes, its in a php document, only thing i can even thing of may possibly be that there is some php.ini configuration at the hosting provider stopping the passing along of the values?
I have also tried it in a few different browsers to make sure it was not some browser security stopping it, but Chrome, Safari and Firefox all show the same.
try splitting the code.
session_start needs to be executed before any html. put it at the very start of the page, even before doc type etc however as this is outside the document the echo will not appear so place that within the body
I mean, of course the certificate expired today, it just seems like the right thing to do, so now i am fighting with getting a new certificate installed which is just giving error after error. Sometimes i wonder how anybody does this web rubbish lol
So true, I have said "sod this, I am retiringâ so many times over the lsst 5 years. Actualky did that once then some sod developed this thing called Wappler and i got hooked again.
OK, thank you @Ben and @Hyperbytes, I took Benâs suggestion and just placed the code all by itself on a new page and all worked exactly as expected, checked my other pages that were not working before and they were still not working.
Moved the script to line 1 of the document, before any other script ran and now everything is working. I am not sure how but if this line of code is placed above the session code it breaks it.
<?php if (substr_count($_SERVER[âHTTP_ACCEPT_ENCODINGâ], âgzipâ)) ob_start(âob_gzhandlerâ); else ob_start(); ?>
To be honest it does not really matter why either, because it works now, so if anyone knows why, it is just more for my own curiosity in my little fact finding mission.
Thanks Wappler, for fixing my non Wappler problems too, haha.
I do it literally as the first thing on the page, actually before doctype as I have known even that to break it. Anything that outputs any type of headers must come after
LIke this: