If the PHP session variable is stored in a file (for example, by default), then let's say that I save the username in the session variable ...
$_SESSION['username'] = 'Jason Davis';
Now that the page is built, if I call $ _SESSION ['username'] 100 times during the page build process, will it succeed with the session files and read them 100 times?
Same thing, but with a session stored in MySQL. Will he query the database 100 times to get the username from the session table?
I'm just trying to figure out if I should name the session variable 1 time per page, and then store it in a local variable and use it for others 99 times. Like this...
$username = $_SESSION['username']; echo $username;
Note. Please understand that this is just an example, in fact I will need to access a simpler username session and 100 times, most likely will be less, but will be distributed across several keywords and session values
source share