fix bug for login in function, last time session variable: username, userid doesn't change.