I know that by using $_SESSION
, one can store values over time. The default time is 1440 seconds = 24 minutes. I would like my values to be stored: for a longer time/until the browser has been closed.
Let's say I want to store the a boolean value and string value. Is session the best way?
For example: $_SESSION["value"] = true;
and $_SESSION["value2"] = "my_string";
?
Is session the best way, or are there any other good/better solutions? The values has to be available for all the pages (.php) on my website.