fixed example to check if the session exists when getting flash messages to avoid starting sessions when not needed
Merge pull request #2564 from fabpot/session

fixed example to check if the session exists when getting flash messages to avoid starting sessions when not needed