Rely on active record to update the sessionid in db
more corrections