I'm thinking about creating a 'session' table that contains a random #, User ID, Date/Time that is populated when a user logs in and the random # used in each displayed page to uniquely identify the person. Each time the user displays a page the record will be updated with the most recent date/time activity, if there has been no activity in the past x hours than I plan on forcing a re-signon. Couple of questions:
- should I include IP (I'm not the concerned about multi-sessions, but thought of it for added security)
- does this work better and is it more secure than the standard PHP session approach (cookies, etc.)
- should I use this method as well as php session (cookie) to match the two to make sure its the right person (cookie including IP, etc.??)
Is there a better approach or standard security pattern that is out there (and I don't know about)?