I'm working on a logon system, something generic and modular, as a part of
a few ideas I have running. I'm just wondering, though, what is the best
way to keep a user logged in authentically throughout multiple pages, while
not taxing the server with a lot of "Look in the database. Is this them?
Can they be here?" MySQL calls.
I'm just wondering how to cut down on the time spent querying the database
to make sure the user is legit on every page they hit. Are PHP sessions the
best way? If I use a stored session key, how do I store the key? Is
checking the database (against a stored cookie) an insignificant draw on
the processor? Should I give up PHP and learn farming?
Any insight is much appreciated.
(More info, if you're interested:) The system is going to consist of a
single MySQL database, with global usernames, md5ed passwords, and the
ability for each user to belong to some of a list of "domains", while
keeping the same username and password. This way, the messageboard, the CD
barcode site, and the restricted-access pages can all use the same database
(easier for me) for authenticating users (for further user-data, each
application will use its own code, with assurance that the logged in user
is legit). Also, users can use one password to skip between "sub-sites" on
my site.
--
-- Rudy Fleminger
-- sp@mmers.and.ev il.ones.will.bo w-down-to.us
(put "Hey!" in the Subject line for priority processing!)
-- http://www.pixelsaredead.com
a few ideas I have running. I'm just wondering, though, what is the best
way to keep a user logged in authentically throughout multiple pages, while
not taxing the server with a lot of "Look in the database. Is this them?
Can they be here?" MySQL calls.
I'm just wondering how to cut down on the time spent querying the database
to make sure the user is legit on every page they hit. Are PHP sessions the
best way? If I use a stored session key, how do I store the key? Is
checking the database (against a stored cookie) an insignificant draw on
the processor? Should I give up PHP and learn farming?
Any insight is much appreciated.
(More info, if you're interested:) The system is going to consist of a
single MySQL database, with global usernames, md5ed passwords, and the
ability for each user to belong to some of a list of "domains", while
keeping the same username and password. This way, the messageboard, the CD
barcode site, and the restricted-access pages can all use the same database
(easier for me) for authenticating users (for further user-data, each
application will use its own code, with assurance that the logged in user
is legit). Also, users can use one password to skip between "sub-sites" on
my site.
--
-- Rudy Fleminger
-- sp@mmers.and.ev il.ones.will.bo w-down-to.us
(put "Hey!" in the Subject line for priority processing!)
-- http://www.pixelsaredead.com
Comment