Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #8393
Partial for #8383 (addresses 2.1 only)
This PR removes PHPSESSID URL handling altogether from SMF. It also addresses the 8.4 SID & session parameter deprecation issues, that are related. The point of the 8.4 changes was to eventually remove PHP's PHPSESSID URL processing.
It goes a bit further and will not write sessions where cookies are not present/allowed. I believe this last part can significantly decrease MySQL CPU workload for websites that are getting crawled heavily (like mine).
Testing thus far is fine. Things work OK with & without cookies. No impact to logon/logoff. No impact to queryless URLs. And there are DEFINITELY far fewer session records, that I believe were all unused anyway.
I have a modlet with this code that I have installed in various test environments & tested. It's on my prod site as well.
Loss of functionality:
Removing PHPSESSID from the URL did break one piece of functionality: Guest captcha verification, for searches & posts, specifically for people with cookies blocked. The image is not displayed. It works fine if cookies are not blocked.
I'm tempted to just leave it alone; I suspect folks who disable cookies run into lots of such limitations.
If we want something cleaner, another option would be to not display the search & post (& login) buttons when cookies are not found. Or an error popup, saying cookies are required. Open to feedback.