When I move a database from one server to another server, I usually perform a backup and restore. However, the last time I tried, I couldn't retrieve the logins with passwords and restore them to the other server. How can I bring over the security information?

You have to manually export, then import, the passwords. Although the sp_password syntax shows an option for transferring in preencrypted passwords, the encryption algorithm isn't the same across all releases. Therefore, you can use this method only to transfer passwords between SQL Servers of the same release. If you use integrated security, this problem doesn't arise.