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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Michael <michael.acs@xxxxxxxxxxxxx>:
> 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@xxxxxxxxxx         | http://vermontbotanical.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux