JamesBondInBlack
JamesBondInBlack

Reputation: 97

Storing sessions in mysql

I have heard about storing sessions in databases. Are there any major advantages? I heard standard sessions do not work too well with clustered servers. I am hosting with MediaTemple, would this be a case for this host?

Also, if i use session_only_cookie and my user disables cookies, will the normal sessions work?

Upvotes: 1

Views: 148

Answers (1)

lanzz
lanzz

Reputation: 43178

Advantages are a bit easier garbage collection of expired sessions, probably a bit faster session data retrieval if you have a very large number of living sessions, and potential session storage sharing between several servers, as you mentioned.

Sessions will not work for users who disable their cookies if session.use_only_cookies is enabled, but disabling it introduces the risk of leaking session IDs via copied URLs and is generally not recommended; also most people who disable cookies are aware of the consequences, or become aware of them very quickly.

Upvotes: 1

Related Questions