Index: /package_branches/invirt-web/cherrypy/code/main.fcgi
===================================================================
--- /package_branches/invirt-web/cherrypy/code/main.fcgi	(revision 2398)
+++ /package_branches/invirt-web/cherrypy/code/main.fcgi	(revision 2399)
@@ -20,5 +20,6 @@
     app = cherrypy.tree.mount(InvirtWeb(),
         '/' if dev else '/main.fcgi',
-        {'/':      {'tools.staticdir.root': static_dir},
+        {'/':      {'tools.staticdir.root': static_dir,
+                    'tools.invirtwebstate.on': True},
         '/static': {'tools.staticdir.on': True,
                     'tools.staticdir.dir': static_dir}
Index: /package_branches/invirt-web/cherrypy/code/view.py
===================================================================
--- /package_branches/invirt-web/cherrypy/code/view.py	(revision 2398)
+++ /package_branches/invirt-web/cherrypy/code/view.py	(revision 2399)
@@ -7,4 +7,5 @@
 import datetime, decimal
 from invirt.config import structs as config
+from webcommon import State
 
 class MakoHandler(cherrypy.dispatch.LateParamPageHandler):
@@ -100,4 +101,10 @@
 cherrypy.tools.remote_user_login = cherrypy.Tool('on_start_resource', remote_user_login, priority=50)
 
+def invirtwebstate_init():
+    """Initialize the cherrypy.request.state object from Invirt"""
+    cherrypy.request.state = State(cherrypy.request.login)
+
+cherrypy.tools.invirtwebstate = cherrypy.Tool('on_start_resource', invirtwebstate_init, priority=100)
+
 class View(object):
     _cp_config = {'tools.mako.directories': [os.path.join(os.path.dirname(__file__),'templates')]}
