cookies

creating cookies on file:/// url - evidence it is being created but not showing in document.cookie or cookie list in chrome dev tools

自古美人都是妖i 提交于 2020-06-27 19:43:56
问题 I have some code that creates cookies. It creates two different user groups, checks for what group the users cookie is and does something based on it. The code is being developed on a local machine so it is accessed through a file:/// URL It looks like this: function cookieCreation() { var groupId = Math.floor(Math.random() * 2) + 1; var expDate = new Date(new Date().getTime()+60*60*1000*24).toGMTString() document.cookie = "userGroup_" + groupId + ";" + "expires=" + expDate +";path=/"; }

Python Flask - Setting a cookie using a decorator

狂风中的少年 提交于 2020-06-27 13:12:27
问题 I'm trying to write a decorator that checks for a cookie, and sets one if it doesn't exist. This is my desperate attempt to get the idea across. def set_cookie(f): def decorated_function(*args, **kws): if 'cstc' in flask.request.cookies.keys(): return make_response(f).set_cookie('cstc', value='value') else: return f return decorated_function @main.route('/home') @set_cookie def home(): return render_template('main/home.html') Right now I'm getting error: TypeError: home() takes no arguments

HTTP Redirect (302) Doesn't Use Cookie in Following GET Request

瘦欲@ 提交于 2020-06-27 12:55:45
问题 Here is a question I have been researching for some time now. I have a redirect that does not seem to be respecting a Set-Cookie attribute in a 302 Redirect. Here are the request and response headers that I used wireshark to obtain. HTTP/1.1 302 Moved Temporarily\r\n Connection: close\r\n Location: http://192.168.1.1:8888/home/\r\n Set-Cookie: foo=test_data; Domain=192.168.1.1; Path=/\r\n \r\n GET /home/ HTTP/1.1\r\n Host: 192.168.1.1:8888\r\n Connection: keep-alive\r\n Upgrade-Insecure

CORS, withCredentials and third party cookies

一笑奈何 提交于 2020-06-27 11:49:17
问题 I'm trying to do a CORS GET that sends the cookie along with it. I've set all the headers ( access-control-allow-origin , access-control-allow-credentials , access-control-allow-headers ) in the server and am using withCredentials: true and crossDomain: true in the jquery ajax request. Everything works when I tell my browser to allow third-party cookies. Is there any way to do this without forcing visitors to allow third party cookies? I've even tried redirecting the user and redirecting back

Cookie not being set in browser

耗尽温柔 提交于 2020-06-27 09:26:36
问题 I am trying to set a cookie which has my auth token in it. I can see it being returned in the response header set-cookie: xxxxxx but for whatever reason, the browser is not storing the cookie. On my react front end http://app1.dev:3001 I am making an POST api call as such: return axios.get( `${apiUrl}/info`, { withCredentials: true } ) .then(res => res.data) .catch(console.error) And I have a simple Koa server running on http://localhost:3000 const Koa = require("koa") const Router = require(

How to Copy Cookie to WKWebview in iOS?

百般思念 提交于 2020-06-27 06:16:32
问题 I don't know how/which cookies are coming from which website. Because of that, I can't set manually the cookie names. How can I get third party cookies to paste to a WKWebview ? Here is my code but no chance. My webview; public class CustomWebView : WebView { public static readonly BindableProperty UriProperty = BindableProperty.Create( propertyName: "Uri", returnType: typeof(Uri), declaringType: typeof(CustomWebView), defaultValue: default(string)); public string Uri { get { return (string

need to refresh the page after removing cookie

时光怂恿深爱的人放手 提交于 2020-06-17 16:19:47
问题 iam using a code to remove the cookie from browser and is worked as expected. But after this cookie removal i need to refresh the page manually . i want to refresh the page automatically after removing the cookie. Please help me to solve this. for (var i = 0; i < count; i++) { var domainName = all_cookies[i].domain.replace('.com',''); var domainnameapp = domainName.replace('.',''); var url = "http" + (all_cookies[i].secure ? "s" : "") + "://" + all_cookies[i].domain + all_cookies[i].path;

What does Priority=High mean in the Set-Cookie header?

戏子无情 提交于 2020-06-16 03:03:02
问题 I've been looking at Chrome's traffic in Fiddler, and I found something that I feel I don't understand: Set-Cookie: GAPS=1:ZYBtVMzURzU2umKMxZThJ2lVPxy3Hg:SvHhlG2k1Vy5pnA0;Path=/;Expires=Wed, 04-Nov-2015 20:44:37 GMT;Secure;HttpOnly;Priority=High I can't find any documentation on what Priority=High is for. What does it mean? 回答1: Basically this is a spec by at least chrome (I didn't see it for other browsers) that allows cookies to be prioritized for when they are re-authenticated. Cookies get

On Safari, cookies are not saved when sent with redirect

前提是你 提交于 2020-06-15 11:24:58
问题 I have implemented an OAuth2 client, in which the first step is to send a user to the relevant 3rd party (facebook for this example), I set them a state cookie, and when they return from facebook I validate that state cookie. In Chrome, everything is great. When I send the user to the redirect URL, I can see (using inspect element) that they have the state cookie I set. However, when I try on (desktop) safari on latest MacOS, I don't see that cookie. I set the cookie in the response for my

From IOS 13.0 cookiesDidChange is never triggered when cookies change on webview

会有一股神秘感。 提交于 2020-06-15 05:47:06
问题 I am using Cookie Store Observer to to track changes in the cookies value on my webview. It was working fine on all versions of IOS. but since IOS 13.0 came out, this no longer works. I am not getting any call to @available(iOS 11.0, *) func cookiesDidChange(in cookieStore: WKHTTPCookieStore){ cookieStore.getAllCookies { cookies in //Store cookies to UserDefaults on Background Thread DispatchQueue.global(qos: .userInitiated).async { self.storeCookies(cookies: cookies) } } } I am setting