Added session_expires check. Resolves #2344
Merge pull request #2377 from ivanmushketyk/session-expires

Check session_expires