How can I get "_U" cookie from bing.com? #58
-
Hi, sorry if this is a simple question. I have a JS code to get "_U" cookie from a page. But I don't know how to use it on bing.com. The blow is my funciton. function getCookie() {
const cookieName = "_U";
const cookies = document.cookie.split(';');
for (let i = 0; i < cookies.length; i++) {
const cookie = cookies[i].trim();
if (cookie.startsWith(cookieName + '=')) {
return decodeURIComponent(cookie.substring(cookieName.length + 1));
}
}
return null;
} |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
You don't use it on bing.com; you go to bing.com and get the |
Beta Was this translation helpful? Give feedback.
-
Thank you!! By chance, is there any way to grab the key using iframe? |
Beta Was this translation helpful? Give feedback.
-
I think you can just grab it manually. It lasts indefinitely so you don't need to worry about refreshing it. |
Beta Was this translation helpful? Give feedback.
You don't use it on bing.com; you go to bing.com and get the
_U
cookie (you can grab it from DevTools), and then you give it toBingAIClient
to use it.