> Since I'm building rails app just for learning proporses this could > work, but what happend if this were a real app and another person > tries to log-in using the same user-pass, it would allow 2 or more > people logged with the same user.
Two different problems. 1) Different people are able to login at the same time with the same username using different PCs. To prevent that you need to write into the database when someone is logged in and have them logout or timeout. 2) Someone on one PC logs in, closes the browser, re-opens the browser and attempts to login again. That is what's giving you a problem in your original post. So do what was recommended and automatically login the user if they still have a valid session. > I'll check what a session cookie is and write if that worked. A session cookie expires when the user closes their browser. If you really want to force the user to re-login when they close the browser and then re-open it soon thereafter this is the way to go. But this doesn't at all prevent multiple people from using the same username/ password at the same time. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

