A quick question that just crossed my mind. Having a shared hosting package, I've been storing my sessions in a database for some time now. Works great. The thing is that in every domain pointer's database I created a new table called "_sessions".
Now I thought: why not create one central database that stores all sessions for every domain on my account?
Advantages? No need to create that same "_sessions"-table over and again. More generic setup. Keeps databases 'cleaner'.
Disadvantages?
(As far as I know, by default all the sessions on shared hosting are stored in the tmp/ directory so I guess storing all my sessions in one database should be no problem. Or I am overlooking something here?)
Session management in 1 database on shared hosting
Moderator: General Moderators
Great. However, I just did think of some disadvantages.
I have a field called "userid" in my sessions table. That way I can easily extract data for stuff like "who is online" pages. When using a different database for storing sessions, joining the sessions table with the users table is not possible anymore.
I have a field called "userid" in my sessions table. That way I can easily extract data for stuff like "who is online" pages. When using a different database for storing sessions, joining the sessions table with the users table is not possible anymore.
You mean like first selecting the online user IDs from the sessions table. Then selecting the usernames and other info from the users with those ID's. However, I don't feel like going through the hassle of splitting this up, and adding domain references, etc.
This topic was just a quick thought of mine. Now I know the intended setup should be possible, but in the end I prefer to leave things as they are. It still works after all. Thank you for the input, feyd.
This topic was just a quick thought of mine. Now I know the intended setup should be possible, but in the end I prefer to leave things as they are. It still works after all. Thank you for the input, feyd.