Session Storage in a MySQL Database
Tutorials Shared by the Internet Community
Total Hits - 31837
Total Votes - 27 votes
Vote Up - 14 votes
Vote Down - 13 votes
Domain - www.apphp.com
Category - PHP/Security
Submitted By - Chara Miteo
Submitted on - 2014-07-09 02:31:34
You may know that Sessions are very critical component of creating dynamic websites and web applications. When we build such type of website, we will most certainly be required to add handle of Sessions at some point.
When keeping session variable at the server they are usually placed in special files, at a location specified by session.save_path. To find out where it is you can use a call to phpinfo() function. Unfortunately if your website is placed on a shared server you cannot rule out the possibility of other users (also working in your server) sneaking a peek at these files.
So.. in this tutorial we'll be looking at PHP Sessions: why you need them, how they should be stored and we'll give you a complete class for handling Sessions within a database. More detail...