Skip to content
This repository was archived by the owner on Mar 16, 2019. It is now read-only.
This repository was archived by the owner on Mar 16, 2019. It is now read-only.

[IOS] Cookie not set on redirect #232

@jeremistadler

Description

@jeremistadler

The cookie is not saved when redirecting on IOS. The server responds with Set-Cookie and a Location header, but the next request made does not have a cookie.


React Native: 0.39.0
react-native-fetch-blob: 0.10.0


Code used to fetch resource

RNFetchBlob
.config({
  'RNFB-Response': 'base64',
  fileCache : true,
})
.fetch(method, encodeURI(url), { 'User-Agent' : customUserAgent })
.then(res =>  res.base64())
.then(payload => {
    log('Downloaded as base64',  url, payload);
});

First request

GET /nykopingsenskilda/jsp/app/Login.jsp?action=singlesignon&usertype=1&ssusername=####&appkey=####&schoolId=(null)&redirect=right_student_schedule_print.jsp%253Fprint=1%2526student=####%2526term=&activeChild=#### HTTP/1.1
Host: #####
Accept: */*
Accept-Language: en-us
Connection: keep-alive
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.84 Safari/537.36

First response

HTTP/1.1 302 Found
Server: Apache-Coyote/1.1
Set-Cookie: JSESSIONID=####; Path=/nykopingsenskilda/; Secure; HttpOnly
Location: ../student/right_student_schedule_print.jsp?print=1&student=####&term=
Content-Type: text/html
Content-Length: 0
Date: Mon, 16 Jan 2017 10:33:17 GMT
Cache-Control: no-cache
Connection: Keep-alive

Second request (from redirect)

GET /nykopingsenskilda/jsp/student/right_student_schedule_print.jsp?print=1&student=####&term= HTTP/1.1
Host: #####
Accept: */*
Accept-Language: en-us
Connection: keep-alive
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.84 Safari/537.36

Second response (from redirect)

HTTP/1.1 302 Found
Server: Apache-Coyote/1.1
Location: ../../html/redirect_login.htm
Content-Type: text/html;charset=ISO-8859-1
Content-Length: 0
Date: Mon, 16 Jan 2017 10:33:17 GMT
Cache-Control: no-cache
Connection: Keep-alive

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions