Revert "Remove explicit calls to valid?"

This reverts commit de3160be50ca59877ad7f61fef69995a0f6581dd.
Revert "[#45300121] Add session_id for authentication"

This reverts commit 8b86e20cbd00156c6c32d1a68d5850799f26361c.