The book recommends gem 'rack-flash' for session-based notifications, but rack-flash doesn't work with up-do-date versions of rack. The sinatra-authentication gem also requires rack-flash.
alternate for that is rack-flash3, check this out nakajima/rack-flash#8
Yeah, I had tried that and ran into something undesirable - I don't remember what. I ended up using sinatra/flash on recommendation of one of the core team. I guess that is what the book should be recommending.
For the time being, you can use rack-flash3 or sinatra-flash gems.