Coder Social home page Coder Social logo

Comments (9)

silkimen avatar silkimen commented on June 28, 2024

Hi Cornelius,

it's not exposed in ionic because it's not even exposed in this plugin. What do you need that function for? It's meant to be used internally to create the cookie header. Can you explain your use-case?

from cordova-plugin-advanced-http.

cnotoham avatar cnotoham commented on June 28, 2024

Hi Sefa,

I have a requirement whereby I need to set Cookies into an iframe in an ionic application.

from cordova-plugin-advanced-http.

silkimen avatar silkimen commented on June 28, 2024

Hmm ok, I still don't understand your use-case. This function is meant to create the cookie header string which is sent to the server. So if I'd expose this function you'd be able to get the stored cookies for a specific server. I'm still not sure if this is a good idea (security concerns). But how do you want to use this in an iframe?

e.g. running a GET request to http://www.google.de/

// first time internally call (no cookies are set, yet)
getCookieString('http://www.google.de/') --> '' (returns empty string)

// second time internally call (got a set-cookie answer from google on first request)
getCookieString('http://www.google.de/') --> '1P_JAR=2017-11-14-14; NID=117=eNWNV8UDsZIqxAvqTIZm290wdHWmeJyKwvYzEHsIUFu2CYu10ghFTSvPvS-Q2FSLu3QQw' (returns cookie string)

Is this you want to have?

from cordova-plugin-advanced-http.

cnotoham avatar cnotoham commented on June 28, 2024

Sorry, I should have explained it to you much better. This is my project requirements ...
I have to develop a single sign on (SSO) app. Authentication is achieved by using this advanced-http plugin and got the Cookies from the server. I then need to load an app within an iframe. This app is loaded via the same authenticator and this authenticator needs the cookies otherwise it will redirect to the authenticator login page.

So for example, authenticated via https://www.xxx.org by using this plugin and then for the iframe, the src url would be:
https://www.xxx.org/someapp

I have written this app in ionic.

I hope this is a bit clearer.

Thanks so much

from cordova-plugin-advanced-http.

silkimen avatar silkimen commented on June 28, 2024

Ok, thank you for your detailed description. The function "getCookieString" will be exposed in v1.9.0.

from cordova-plugin-advanced-http.

cnotoham avatar cnotoham commented on June 28, 2024

Thank you

from cordova-plugin-advanced-http.

Bessonov avatar Bessonov commented on June 28, 2024

Hello @silkimen,

I don't use this plugin yet, but is there any way to access HttpOnly cookie?

from cordova-plugin-advanced-http.

silkimen avatar silkimen commented on June 28, 2024

Hi @Bessonov,
yes, you can access HttpOnly cookies just like the other cookies by calling getCookieString(url).

from cordova-plugin-advanced-http.

Bessonov avatar Bessonov commented on June 28, 2024

Thank you for your response, @silkimen! But I don't think this is a good idea, because this isn't intended behavior of HttpOnly and leads to XSS. Therefore I can't use this plug in :(

from cordova-plugin-advanced-http.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.