Is it possible to store values dynamically “in the server” in PHP? I mean, a session with variables that are accessible to every user.
For example, a variable (‘$multipleUserVariable’) that is increased by one every time a new user loads the page, like this:
session_start();
if (!isset($_SESSION['PHPSESSID']) {
$multipleUserVariable++;
}
I’m almost sure the only way to do this is using a database, but still.
Thanks!
I don’t think that’s possible. Thats not the purpose of sessions.
You have many other options – any database, writing to filesystem or caching engine…