Session handling moved to viewmodel class