Consider the situation when two servers are simultaneously processing two separate requests to the same session.
-
Request(1) comes in and is processed by Server(A)
a. The session is loaded and the variableSession.foo
equals the value"bar_1"
.
b. Then it changes a session variable by executingSession.foo = "bar_2";
-
Request(2) comes in and is processed by server(B) while request(1) is still being processed:
a. The session is loaded, but since Request(1) hasn’t finished, the same session that Request(1) initially loaded will be loaded
b. The variableSession.foo
equals the value"bar_1"
-
Request(1) completes
a. The session is written to the session db and the variableSession.foo
has updated with the value"bar_2"
-
Request(2) completes - What happens to the variable Session.foo?
a. Will Lucee see that this request has not changed the value ofSession.foo
and therefore will not update it?
b. Or will Lucee update the entire session, overwritingSession.foo
back to the value “bar_1”?