modify session controller as Listing 8.13