They are 2 totally different things. Not even remotely related.
SESSION variables are used to store information you may use during the stay of a user in your website. such as their login, or in the case of a shopping cart there selected items.
require() is used to bring a file with php commands, functions variables etc.. into the current one so its variables and code are available in the current script.
The are used for different things. so really cannot be compared.
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
Since I've been doing this recently, I assume that you are looking into data filtering to secure your site. A quick search for that usually turns up the "Dispatch Method" (which uses sessions) and the "Include/Require Method". If that's what you're actually looking for, I have two suggestions.
One: word your questions better, this leads to better answers and less snark.
oddly enough, the coding structure that I use most often is historically called the despatch method. I use sessions, but not for the despatching. For that, I pull in the appropriate scripts using require_once.
curious how the same terminology appears to be appropriated for subtly different purposes across the years!
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.