BUG Fix access to protected Session::current_session()

Fortunately this issue would not come up in a clean install, since the framework only ever calls `Versioned::choose_site_stage` with a parameter. Rather than determining the session to pass the state to, we determine the state before conditionally assigning it to the given session, or the static session::set

Fixes #3144