added a getCookie method