Redo cookie code for device orientation
Make the cookie work for saving devices (not yet for orientations)