简体   繁体   中英

How to preserve a cookie between frames in electron?

I use electron 0.36.0 and I have a cookie for a page and this page has a nested frame with a different domain.

I need to somehow keep a cookie alive when going to this frame directly (different domain) and ideally, I want to avoid upgrades of electron (otherwise I would have to rewrite my code).

What's an ideal solution for my situation (it can be also a small workaround)?

Thank you!

Cookie现在可以与不同的域共享,因此您将不得不找到一种不同的方式来做您想做的事情。

For cross domain cookies alcuadrado has described a work around to do this in his post like below:

  1. centralize all cookies in a single domain, let's say cookiemaker.com
  2. when the user makes a request to example.com you redirect him to cookiemaker.com
  3. cookiemaker.com redirects him back to example.com with the information you need

check this answer and this .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM