Got login/out/checksession working on server side and almost on client site.