Login using Servlet and JSP | How to Prevent Back button after Logout? | Part 2

Telusko

Telusko

13 min, 59 sec

This video explains how to address the back button cache issue in web applications using Servlet and JSP, including code modifications and caching strategies.

Summary

  • The video begins by acknowledging the success of a previous tutorial on using servlet and JSP for login functionality.
  • The presenter identifies a common issue where users can navigate back to a secure page after logging out due to page caching.
  • The video demonstrates code changes in Eclipse to improve security, including changing the form method to POST and hiding password input.
  • To prevent the back button from showing cached secure pages, the presenter adds headers to instruct the browser not to cache these pages.
  • The video concludes with a discussion on session objects and the importance of server-side session management for individual user sessions.

Chapter 1

Introduction and Issue Identification

0:00 - 43 sec

Introduction to the video and identification of the back button issue in web applications.

Introduction to the video and identification of the back button issue in web applications.

  • The presenter, Ivan, welcomes viewers back to the channel and sets the context for the tutorial.
  • The issue discussed is the ability to see a secure page after logging out and using the back button of the browser.
  • Ivan compares this behavior to how Facebook correctly redirects to the login page after logging out.

Chapter 2

Code Review and Initial Changes

0:42 - 1 min, 58 sec

Review of the existing code and initial changes to improve security and functionality.

Review of the existing code and initial changes to improve security and functionality.

  • Ivan reviews the existing code in Eclipse and runs the application to demonstrate the issue live using Firefox.
  • Changes are made to the login page to hide the password characters and to change the form submission to POST method for better security.
  • The presenter also plans to replace a hyperlink with an embedded video in the application.

Chapter 3

Fixing the Back Button Cache Problem

2:40 - 9 min, 25 sec

Implementing headers to instruct the browser not to cache secure pages to solve the back button issue.

Implementing headers to instruct the browser not to cache secure pages to solve the back button issue.

  • Ivan demonstrates how to set HTTP headers to prevent the browser from caching the secure pages after logout.
  • Headers like 'Cache-Control', 'Pragma', and 'Expires' are set in both the Welcome and Videos JSP pages to manage caching behavior.
  • After making these changes and restarting the server, the logout functionality is tested to confirm that the back button no longer shows the cached secure page.

Chapter 4

Session Management and Final Thoughts

12:05 - 1 min, 53 sec

Explaining session management in web applications and summarizing the tutorial.

Explaining session management in web applications and summarizing the tutorial.

  • Ivan discusses the use of session objects and reassures that they are specific to each browser instance, ensuring individual user sessions are managed securely.
  • The video concludes with a reminder to implement database-driven user authentication in future tutorials and a brief discussion on JavaScript validation.
  • Ivan encourages the viewers to like and subscribe for more videos.

More Telusko summaries

What is Blockchain?

What is Blockchain?

Telusko

Telusko

The video provides an in-depth explanation of blockchain's importance, its decentralization, how transactions are recorded, and the role of miners.