Login Form. If you need to login a user from the front-end of your site, you can do so with the following code:.