add session middleware support