Forum Moderators: coopster
I'm kinda a newbie myself, but I think the reason behind storing sessions in a mysql database is that it gives you more possibilities. For example, if you have an online community and you want to display who's online right now, you need a place where all the active sessions are stored. You simply save the session ID and the corresponding username (and/or UserID) in a table and then it's pretty simple to tell who's online at the moment.
You can probably do much more things, which I haven't discovered yet :)
Dan
Personally I am very much anti-Cookies period.
When you open up a PHP session, like all Server-side Session functions including ASP, at least one single cookie has to be created on the client PC. This in itself is no big deal, but if you are expecting a cookie-less client to use your system, the Session function will fail.
This is why I use database driven (MySQL, Interbase etc) Session functions, which passes the session string between pages either as a Post or a Get to create the seamless illusion of Statefulness.
Also, as DWIDMER (Hi Dan) suggestes, you can monitor and gauge browser activities more precisely if it is stored and controlled using a database.
Rgds, Les