What you’re doing is defining a custom action where you create a new request builder. So? This request builder is never built and the resulting request executed.
Meaning that session.setAttribute(“foo”, “bar”) will return a new Session instance that has to be returned. That’s why when executing a custom action, you’re expected to return a Session instance.
.exec{(session: Session) =>
session.setAttribute(“foo”, “bar”) // creates a new Session instance, and return it (in Scala, the result of the last operation in the block is returned)
}