Perspective Login/Logout

Hey guys!

Not sure of the functionality, but i’m trying to create a button that will allow a user to login/logout. One thing I noticed when using the logout function, which worked great, on execution of the login script it automatically signs in as the previous user. Is that supposed to happen?