PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I have an application that has user verification. The problem is, if I login, someone else on a different connection can login at the same time using my user name & pw. Can someone point me in the right direction to prevent this?
But each page that is accessed, generally starts a new session...I think. I mean I have the session tag at the start of each page. Do you know of any samples I can maybe pull some code from and get to work.
You have to do that yourself, add two fields to the users table that says which sessionID they are using and the time they last used it, then you can update those on each page view and check against it, if a user tries to use a sessionID that differs from one they used within X minutes ago you assume its a duplicate user. If the user manually logs out you'd want to reset these fields so they can log back in again.
By "bind" I think jshpro2 means to associate the session with the user record in the database. This could be a field in the user record where the session ID is saved upon login or a separate table to track userID/sessinID pairs. Obviously logout would clear this field. The trick is what to do with abandoned logins.