Adding sessions and flash message support