Storing Session In Db V.s File, Which One ?

I know that some people stick to file based session, and some others use DB to manage their sessions.

I wanted to know, In Yii which one is preferred and what are the advantages and disadvantages of either

based on your experience ?

I also would appreciate if anyone can tell me how to implement something for tracking who is online

right now. I saw a bunch of posts but they were kind of complicated in the sense for what I want to

do. I want to be able to query all the users who are online now. Any simple way to do that or do you

know of any post that explained such thing in easy steps ?



use this… it straight away stores session information in database

hope this helps you :)