November 2017
Intermediate to advanced
542 pages
14h 24m
English
In the past, Spring Security required you to provide your own Cache-Control method for your web application. This seemed reasonable at the time, but browser caches have evolved to include caches for secure connections as well. This means that a user may view an authenticated page, log out, and then a malicious user can use the browser history to view the cached page.
To help mitigate this, Spring Security has added Cache-Control support, which will insert the following headers into your response:
Cache-Control: no-cache, no-store, max-age=0, must-revalidatePragma: no-cacheExpires: 0
Simply adding the headers() method with no child elements will automatically add Cache-Control and quite a few other protection options. However, ...
Read now
Unlock full access