Starting/recreating session mechanism upon init, login and logout