Changing array of session to object