If you just read our Gmail Sign in tutorial, you will know that the Gmail login process happens behind the scenes, and is initiated whenever you hit the Enter key or click on the "Sign in" button after you've entered your credentials (user name / email address and your account password). In this tutorial, we will explore the login process as it works in the background - understanding this process, even superficially, allows you to make better decisions when it comes to your online security, whether it be with your Gmail account, or any other website that requires authentication (but we focus on Gmail in this page).
Let's assume that you are logging into your Gmail account for the first time, and that no one has ever accessed Gmail from the computer and browser you are using: this is a blank canvas, there are no cookies or settings to remember for a previous Gmail account. In that case, if you type "www.gmail.com" in your browser's address bar, you will invariably be met with the Gmail sign in form, which needs to collect your account information ("credentials"), to know which inbox, emails, and profile to load next:
Once you have enter your email address and password and hit Enter / Return, or click on the Sign in button, the form is submitted to Google's servers: Google will then check your combination of user name (the email address) and password you have entered.
Case # 1: the combination doesn't match any valid credentials, so no login session is initiated; Google will bring you back to the Sign in form with an error message:
If you see a "The username or password you entered is incorrect" notice from the sign in form, start by double-checking for typos in the email address, then make sure that Caps-Lock is not turn on (which would make you type your password in all-uppercase), and finally retype your password carefully.
Case # 2: the email address and password you entered are a match, and you will be signed in to your Gmail account, be able to check your emails, edit your profile, etc.
Behind the scenes, during a successful login, Google will check if you choose to "Stay signed in" by clicking on the checkbox in the sign in form: if this is the case, it will create a "cookie", or small text file, letting it and your browser know that you should login automatically next time you visit www.gmail.com, or try to access any Gmail by another mean (like a browser Favorite / Bookmark, an external link, etc.) If you have not checked the "Stay signed in" checkbox, no cookie will be created on your computer, and you will see the Gmail sign in form whenever you try to access your emails.
For your security, even if you choose the option to stay signed in to your Gmail account, that cookie will expire after a certain period of time (or be deleted if you manually clear your cookies). At this point, you will need to login again (and the process starts over).
Likewise, if you have not chosen the option to stay signed in in the Gmail Sign in form, you will automatically be signed out after a period of inactivity - this is to protect access to your account and emails, in case you forgot to manually sign out.
There are two things to remember about the Gmail login process: first, never choose the "Stay signed in" option outside a safe computer (your own, presumably) - this will avoid the creation of a cookie, which could lead someone else to accidentally end up in your inbox without having to enter a user name and password.
Second, always manually sign out (click on the "Sign out" link, as shown on the screenshot below) whenever you are not using Gmail on your own, password-protected computer.
For more information, please see "Gmail Sign out (completely logout)".