If possible store the passwords on the users machine and never transfer them to your back end web service. If you choose not to do so then when your server is compromised all those passwords will more than likely be stolen.
Services such as lastpass wish their users to be able to access their passwords no matter what machine they are on so they encrypt and decrypt everything on the user's side and only ever transfer the encrypted passwords to their server. The key which is needed to decrypt the passwords is only ever in the end user's head (or on their machine if they choose to save it) and is never transfered to the server.