replace deprecated sessions functions