log in and out functionality added with session method and permanent cookies