Cookies not working for mobile device/emulator

Hello, I’m initiating Webpagetest runs from the API. I use setCookies to set login credentials for websites and that has been working well for desktop sites. I wanted to test sites on mobile, either real devices or with the mobile emulator. I’ve tried real devices (iPhone X, Moto G6) as well as the emulator by setting mobile to 1 and mobileDevice to the device name settings and in both cases, it seems like cookies aren’t being recognized for the mobile site and the page shown in the screenshots are of a logged out experience.

Is there anything I need to do to set cookies for a mobile device/emulator? I’m currently using the same cookies as the desktop site and just setting mobile/mobileDevice option or changing the location and browser to the correct mobile device.

1 Like

Are you sure the mobile site uses the same cookies? Can you look at the actual http requests and see if the cookies are sent?

Mobile emulation literally uses the same code and browser as desktop so I wouldn’t expect to see any differences on the testing side.

1 Like

Thanks, I did end up double checking the cookies and noticed an issue with the url so I have fixed that and it now works with the emulator and on android devices. However, on iPhone 8 (or any iOS device), I don’t see the cookies being sent. Is that a limitation of iOS itself? I don’t see “cookie” as part of the request header

1 Like