I have an activity that lets you sign in to a page. In the next activity it should display a webpage based on the cookie if the login was successful. The cookie is retrived
First of all, make sure to read the header values that your website gives you. You can determine this via Wireshark.
Secondly, when you know how the cookie look like (based from your Wireshark values), you should try to achieve the same values in your code. Make sure to debug the cookie's value(s) and make adjustments on the cookie itself if it doesn't match.