Run the project by executing the following command:
mvn jetty:run
Wait for the console to print [INFO] Started Jetty Server.
Open a browser (I use Firefox in private mode for testing) and navigate to http://localhost:8080, and you will be shown the custom login page that you created, as shown in the following screenshot:
Enter user/user@password as the username and password. Click on Remember me and click the Login button, and you will be navigated to the user home page, as shown here:
Query your MySQL database for the persistent_logins table, and you will see a new record, as shown in the following screenshot:
Now, go to the developer tools in your browser and check for cookies. Depending on the browser that you are using, you should see something similar to this:
The entire project for this example can be found at the book’s GitHub page in the jetty-db-basic-authentication-remember-me project.