         request.allHTTPHeaderFields = headers
 
         let cookieStorage = NSHTTPCookieStorage.sharedHTTPCookieStorage()
+        cookieStorage.cookieAcceptPolicy = .Always
         let cookieHeaders = NSHTTPCookie.requestHeaderFieldsWithCookies(cookieStorage.cookies!)
         request.allHTTPHeaderFields = cookieHeaders
 

            request.setValue(String(query.lengthOfBytesUsingEncoding(NSUTF8StringEncoding)), forHTTPHeaderField: "Content-Length")
        }

        NSURLSession.sharedSession().dataTaskWithRequest(request) { (data, response, error) in
            if error == nil {
                completionHandler(response: String(data: data!, encoding: NSUTF8StringEncoding))
            } else {
                completionHandler(response: nil)
            }
        }
    }
}
     - parameter data: Name-data pairs.
     - Note: We try to use the same NSHTTPCookieStorage as we can only have a singleton of it. It seems we don't need separate CookieStorage anyway.
    */
    public static func mobileLoginRequest(url: String, method: String, data: [String: String] = [:], headers: [String: String] = [:]) -> String? {
        return request(url,
                method: method,
                data: data,
                headers: headers,
                referer: APIEndpoints.community + "/mobilelogin?oauth_client_id=DE45CD61&oauth_scope=read_profile%20write_profile%20read_client%20write_client"
        )
    }

    public static func request(url: String, method: String, data: [String: String] = [:], headers: [String: String] = [:], referer: String = APIEndpoints.community) -> String? {
        var url = url
        let query = data.map { k, v in
            k.stringByAddingPercentEncodingWithAllowedCharacters(NSCharacterSet.URLQueryAllowedCharacterSet())! + "=" + v.stringByAddingPercentEncodingWithAllowedCharacters(NSCharacterSet.URLQueryAllowedCharacterSet())!
