Enclosed session id check/gen