         
         let task = URLSession.shared.dataTask(with: request, completionHandler: completionHandler)
         task.resume()
+        
+        UserDefaults.standard.storeCookies()
     }
 }

                let urlStr = response.url?.absoluteString {
                if urlStr == targetUrl {
                    completionHandler(data, response, error)
                } else if urlStr.contains(self.reauthUrl) {
                    self.makeRequestWithReauth(shibbolethUrl: shibbolethUrl, html: html as String, completionHandler)
                } else {

                self.makeRequestWithShibboleth(shibbolethUrl: shibbolethUrl, html: html as String, completionHandler)
            } else {
                completionHandler(nil, nil, NetworkingError.authenticationError)
                UserDefaults.standard.storeCookies()
            }
        }
        task.resume()
