Session js rearrangement