spring-session
spring-session copied to clipboard
Session syncronizaton and Storage
I'm not sure if my lack of understanding is really a bug but not sure where better to ask this question. Looking through the code I've run into the HttpSessionSynchronizer.java file and am stuck in it's implementation.
Looking at the doFilterInternal function call, assuming a number of preconditions are met, the code walks over all the session attributes and sets the session attributes to the current session attribute's values. I know this works by downloading the code and independently verifying the code myself but what I can't understand is WHY it works. I'm hoping someone here would be willing to give an explanation about what is going on in this code.
if there is a better place to post this please feel free to link that below. Thanks again for your help.
@slick666 To understand WHY this work you need to check Spring-Session https://projects.spring.io/spring-session/. On every HttpSession#setAttribute call, it updates the value for the given key (if it exists) else create a new entry in the datastore (Mongo, Redis, JDBC etc). Hope this answers your question. Do let me know if you need detail explaination.