Common way to store db-password of open session?
| From: | Andreas | Date: | Tue, 29 Nov 2011 08:04:08 +0000 |
| Subject: | Common way to store db-password of open session? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-315863@lists.php.net to get a copy of this message | ||
Hi,
is threre a most advisble way to store db-passwords of an open user-session?
As far as I get it, a common login strategy is to let the user login by name&password, check it, store a login=TRUE as php-session variable and later use a common dbuser+pw to query data provided "login" is TRUE.
This way one wouldn't have to store the users pw or actually the user wouldn't have a real db-account but rather an application account.
Is this really better or equal than using real db-accounts?
Should I rather store the db-credentials in a session or cookies?
Session is vulnerable as any host-user could look into /tmp.
This would generally be a trusted few though.
On the other hand cookies could be manipulated by the user or at least be spied upon on the way between user and web-host everytime the credentials are needed for a query.