working session function