Re: Session Info Storage: Session File or MySQL DB?

From: Date: Fri, 08 Apr 2005 18:44:18 +0000
Subject: Re: Session Info Storage: Session File or MySQL DB?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-212663@lists.php.net to get a copy of this message
* Michael <michael.acs@m5central.net>: > I am currently developing a few security functions for my website and > have finally decided to use the session functions that I have been > avoiding for years since I did not want to change from what I am used to > developing. So now that I have refreshed my brain on how to use > sessions I have to make a decision, Where should I store my session > data, in the session file or on my mysql database, Speed is my main > drive here and I believe the file might be just a few microseconds > faster, but what do you suggest I use? Files are faster, but you really only need to worry about those microseconds on high traffic sites or if your PHP is doing heavy lifting. Some things to think about: * Are you on a web cluster? If so, you'll want centralized session storage. Your options are a database or a distributed file system (NFS or openGFS, for instance) * Are you using a shared host? If so, it's possible for session collision and snooping to happen when using file based sessions. Database storage might be a good idea in this situation. -- Matthew Weier O'Phinney | WEBSITES: Webmaster and IT Specialist | http://www.garden.org National Gardening Association | http://www.kidsgardening.com 802-863-5251 x156 | http://nationalgardenmonth.org mailto:matthew@garden.org | http://vermontbotanical.org

« previous php.general (#212663) next »