User mysql and sessions
Does the credentials used for the mysql connection affect in any way the session variables or such?
I mean, if my database in page 1 is accessed with a certain username/password and in the following one, I access the same database w开发者_如何学运维ith different credentials, does that have any side effect that could break something?
Assuming I'm understanding the question properly:
When storing your sessions in mysql instead of on the filesystem, The mysql username / password used to connect to the mysql database needs insert and select privileges to the table. If you have multiple mysql users who have access, the data that is inserted / selected does not have any context as long as both mysql users have access to the table.
That being said:
You should be using the same user / password to connect to mysql from php. It will work if you use different accounts (if they have privileges), but it has no context on the user's session data and might just end up giving you a headache.
精彩评论