WIP: new middleware to make transparent sessions