 		locals = res.locals
 		body = req.body
 		
-		# Get a DOM window.
-		angularWindow(id, req.headers.cookie, locals).done (window) ->
-			
-			shrub = window.shrub
-			
-			routes = shrub.$route.routes
-			if routes[path]?
-			
-				# Does this path redirect? Do an HTTP redirect.
-				if routes[path].redirectTo?
-					return res.redirect routes[path].redirectTo
-				
+		# Uncomment to bypass the server-side Angular.		
+#		return http.renderApp(locals).done (index) -> res.end index
+
+		extractCookie = ->
+			
+			deferred = Q.defer()
+			
+			# If the client is in sync, awesome!
+			if req.signedCookies[http.sessionKey()] is req.sessionID
+				
+				deferred.resolve req.headers.cookie
+				
+			# Otherwise, stimulate the session middleware to create the cookie.
 			else
-				
-				# Is there no path entry? Check for a default.
-				if routes[null]?
-					return res.redirect routes[null].redirectTo
-			
-			# Navigate the Angular system to the new path.
-			navigate(window, path, body).done (delay) ->
-				
-				# I'm not sure how to synchronize this.
-				setTimeout(
-					->
+				res.emit 'header'
+				
+				# Yank it out of the response headers and map it.
+				setCookie = res._headers['set-cookie']
+				cookieObject = {}
+				for kv in setCookie.split ';'
+					[key, value] = kv.split '='
+					cookieObject[key.trim()] = value
+				
+				# Pull out junk that only makes sense en route to client.
+				delete cookieObject['Path']
+				delete cookieObject['HttpOnly']
+				
+				# Rebuild the cookie string.
+				cookie = ''
+				for k, v of cookieObject
+					cookie += '; ' if cookie
+					cookie += k + '=' + v
+					
+				# Commit the session before offering the cookie, otherwise it
+				# wouldn't actually be pointing at anything yet.
+				req.session.save -> deferred.resolve cookie
+				
+			deferred.promise
+
+		extractCookie().then (cookie) ->
+			
+			# Get a DOM window.
+			angularWindow(id, cookie, locals).done (window) ->
+				
+				shrub = window.shrub
+				
+				routes = shrub.$route.routes
+				if routes[path]?
+				
+					# Does this path redirect? Do an HTTP redirect.
+					if routes[path].redirectTo?
+						return res.redirect routes[path].redirectTo
+					
+				else
+					
+					# Is there no path entry? Check for a default.
+					if routes[null]?
+						return res.redirect routes[null].redirectTo
+				
+				# Navigate the Angular system to the new path.
+				navigate(window, path, body).done (delay) ->
+					
+					# I'm not sure how to synchronize this.
+					setTimeout(
 						
 						# Emit the HTML as it appears.
-						res.end window.document.innerHTML
-					delay
-				)
+						-> res.end window.document.innerHTML
+						
+						delay
+					)

			# Inject Angular services so we can get up in its guts.
			shrub = window.shrub = {}
			injected = [
				'$location', '$rootScope', '$route', '$sniffer', 'forms', 'socket'
			]
			invocation = injected.concat [
				-> shrub[inject] = arguments[i] for inject, i in injected

				domain: get: -> 'localhost'
			)
			
			# Set up a DOM, forwarding our cookie and navigating to the entry
			# point.
			document = jsdom(
				index, jsdom.defaultLevel
				
				cookie: cookie
				cookieDomain: 'localhost'
				url: "http://localhost:#{http.port()}/shrub-entry-point"
			)
			window = document.createWindow()
			
			# Capture "client" console logs.
			window.console = logger
			
			# Hack in WebSocket.
