Made Firebase token accessible in shared session/fixed logic

Made Firebase token available on shared sessions cookie, and fixed some logic arrangements.