BZ-1141816 Centralizing user and session retrieval so that REST requests are also handled