                                             response.setContentType(IOParser.sharedInstance.getContentType(token))
                                             response.setStatusCode(sCode)
                                             
-                                            // TODO: HEADERS & SESSION
-                                            
-                                            // Check for Not secured url
-                                            /*if !url.containsString("https://") {
-                                                self.logger.log(ILoggingLogLevel.Warn, category: self.loggerTag, message: "Not Secured URL (https): \(url)")
-                                                callback.onWarning(response, warning: IServiceResultCallbackWarning.NotSecure)
-                                            }*/
+                                            // HEADERS & SESSION
+                                            
+                                            var endpoint = serviceRequest.getServiceToken()!.getEndpointName()!
+                                            
+                                            if let h:Header = self.headers[endpoint] {
+                                                
+                                                h.cookies = self.extractCookies(httpResponse)
+                                                self.headers[endpoint] = h
+                                                
+                                            } else {
+                                                
+                                                self.logger.log(ILoggingLogLevel.Debug, category: self.loggerTag, message: "There is no previous information on the dictionary of headers and session")
+                                                
+                                                var h:Header = Header()
+                                                h.cookies = self.extractCookies(httpResponse)
+                                                self.headers[endpoint] = h
+                                            }
                                             
                                             switch sCode {
                                                 
                                             case 200...299:
-                                                //self.logger.log(ILoggingLogLevel.Error, category: self.loggerTag, message: "\(response.getContent()!)")
-                                                
-                                                callback.onResult(response)
+                                                
+                                                // Check for Not secured url
+                                                if !url.containsString("https://") {
+                                                    self.logger.log(ILoggingLogLevel.Warn, category: self.loggerTag, message: "Not Secured URL (https): \(url)")
+                                                    callback.onWarning(response, warning: IServiceResultCallbackWarning.NotSecure)
+                                                } else {
+                                                    callback.onResult(response)
+                                                }
+                                                
                                                 return
                                                 
                                             case 300...399:

                            // user-agent
                            request.addValue("\(serviceRequest.getUserAgent())", forHTTPHeaderField: "User-Agent")
                            
                            // TODO HEADERS & SESSION
                            if let h:Header =  headers[serviceRequest.getServiceToken()!.getEndpointName()!] {
                                
                                // There is a header, update the values
                                h.userAgent = serviceRequest.getUserAgent()
                                
                                headers[serviceRequest.getServiceToken()!.getEndpointName()!] = h
                                
                            } else {
                                
                                // There is no header, create one and set it
                                var h:Header = Header()
                                h.userAgent = serviceRequest.getUserAgent()
                                
                                headers[serviceRequest.getServiceToken()!.getEndpointName()!] = h
                            }
                            
                        } else {

            
        } else {
            logger.log(ILoggingLogLevel.Debug, category: loggerTag, message: "There is no previous information for this endpoint: \(serviceToken.getEndpointName()!)")
            headers[serviceToken.getEndpointName()!] = Header()
        }*/
        return request
    }
    
