I'd like your advice on what is used by robust frameworks/code (RoR, Zend, Symfony, Django..).
I use for my User Management system (understand: login, logout, is user logged, user_id, username, etc..;) a simple et tiny framework (userCake). I'm refactoring my code, making API for iPhone/Androi/Js use and I'd like to refresh this piece of code. I need to know if I just rearrange my classes, dependencies, classes and keep the same process OR if I need to change some things.
Current state of play
After the user successfully signIn, I retrieve all his data, serialize it, create a sessionID. I store this sessionID in a user Cookie and all the serialized data on a DB table that links the sessionID and the data.
Then, on my website, each time a page is requested, I retrieve from DB the serialized data matching the sessionID the user has in his cookie/session. I then make a query to be sure that the username and the hashed password matches in my db and my user is still active (not banned or removed). The same is made with my api (the iphone, android, js must give me the sessionID).
I've got a cronjob that deletes from my session Table the one which expired. When a user logs out, it's the same, I delete the line in my db and clear the user Cookie.
What I'm looking for
What I explained above seems good to me. But is it secure enough ?
Is it really needed to double DB check each time that all is fine w/ username and password, can't I just trust the serialized data in my session table?
How all that is done in famous frameworks (Django, Rails, Symfony..)?