abstract the get cookie stuff so it's easier to use it from an app