Login with Remember Me using CodeIgniter and MySQL

In this tutorial, we have to share how to log in with Remember Me using CodeIgniter and MySQL. Remember me function is used to save the login details in the login form entered by the user. This is a very user-friendly feature that helps the user in reducing user attempts and stop to type login details every time again and again. This is a very simple example, you can just copy-paste, and change according to your requirement.
Before started to implement the Login with Remember Me, look files structure:
  • codeigniter-login-with-remember-me
    • application
      • config
        • constants.php
        • routes.php
      • controllers
        • Auth.php
      • models
        • Auth_model.php
      • views
        • auth
          • login.php
          • index.php
        • templates
          • header.php
          • footer.php
    • system
    • index.php
    • assets
      • css
        • style.css
A simple step-by-step guide to help you Login with Remember Me Codeigniter.
Step 1: Create MySQL Database and Table
Step 2: Create a model file
Create a model file named Auth_model.php inside “application/models” folder.
Step 3: Create a controller file
Create a controller file named Auth.php inside “application/controllers” folder.
Step 4: Create a view
Create a view file named login.php inside “application/views/auth” folder.
Step 5: Create a view
Create a view file named index.php inside “application/views/auth” folder.