You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2019/02/11 16:37:11 UTC

[GitHub] FarhadG commented on issue #77: Cookies are not set/stored in iOS

FarhadG commented on issue #77: Cookies are not set/stored in iOS
URL: https://github.com/apache/cordova-plugin-wkwebview-engine/issues/77#issuecomment-462397101
 
 
   Thanks for the response, @adam-h! I took a look and spent a few hours trying to read cookies in my iOS WKWebView, however, no luck :(
   
   Do you have any examples for me to reference to see if I'm doing anything incorrectly?
   
   I'm making a simple request with the following:
   ```js
   // index.js inside of Cordova application
   const xhr = new XMLHttpRequest();
   xhr.addEventListener('loadend', function(evt) {
     console.log({ evt, response: this.response });
   });
   
   xhr.open('GET', 'http://localhost:8000/api');
   xhr.send();
   ```
   
   And here's the mockserver attaching cookies to every request:
   
   ```js
   // server.js
   const cors = require('cors');
   const express = require('express');
   const cookieParser = require('cookie-parser');
   
   const app = express();
   
   app.use(cookieParser());
   app.use(cors());
   
   app.get('*', (req, res) => {
     res.cookie('username', 'john doe', { maxAge: 900000, httpOnly: true });
     res.send('Hello World!');
   });
   ```
   
   Unfortunately, I don't see any cookies in the Cordova application after the server has responded.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org