Thread specific global variables with middleware to hold a reference to the current user.