What’s the use of session variables in php? i know the basics, but how can I tell if a user is online for example? what’s the session id? in general, i just use sessions to “carry” a variable throughout my website but that’s all. Are there any more useful properties?
thanks
The use of PHP Session variables is so that you can associate a group of variables with every user on the site. So when you do
$_SESSION['some_var']you know you will get the value associated withsome_varthat has been assigned to that particular visitor.You say you use them to “carry” variables throughout the time a visitor is on your site. That’s exactly what they’re for, and you’re not missing anything. You’re using them appropriately.