cookies

Javascript Cookies not working in Safari

萝らか妹 提交于 2020-04-13 06:27:07
问题 I've been trying to implement a basic cookie storage function in Javascript, which works as intended in most browsers, but not Safari (8.0.3). I've stripped it down to the below example, where every other browser changes the text to the date that is stored in the cookie, but Safari doesn't store a cookie at all and gives out an empty string (no error messages in the console either). Safari is set to accept all cookies. If I enter the code in the testbed at W3Schools.com, it works in every

Adding 'SameSite=None;' cookies to Rails via Rack middleware?

别等时光非礼了梦想. 提交于 2020-04-13 03:59:49
问题 On February 4th 2020, Google Chrome will require SameSite=None; to be added to all cross-site cookies. Rails 6.1 and soon Rails 6.0 have added a same_site: :none option to the rails cookie hash: cookies["foo"]= { value: "bar", expires: 1.year.from_now, same_site: :none } But older Rails 5.x apps won't receive the upgrade to have access to the same_site options hash. I know the SameSite=None; cookie option can be manually added to Rails in a controller using: response.headers["Set-Cookie"] =

Sending origin cookies in Cors not working with VideoJS

风流意气都作罢 提交于 2020-04-13 03:39:41
问题 I have the following subdomains: stream.example.com sub.example.com Both domains have SSL certificates and are valid. I am using videoJS 7.6.6 which has http_streaming library. On sub.example.com , there is a video tag which sets a dash manifest as source containing links to stream.example.com .VideoJS needs to include laravel cookies from sub.example.com when making a request to stream.example.com links but this is not happening and when i download the HAR result from developer console i see

Sending origin cookies in Cors not working with VideoJS

折月煮酒 提交于 2020-04-13 03:39:13
问题 I have the following subdomains: stream.example.com sub.example.com Both domains have SSL certificates and are valid. I am using videoJS 7.6.6 which has http_streaming library. On sub.example.com , there is a video tag which sets a dash manifest as source containing links to stream.example.com .VideoJS needs to include laravel cookies from sub.example.com when making a request to stream.example.com links but this is not happening and when i download the HAR result from developer console i see

爬虫基础

一笑奈何 提交于 2020-04-08 11:50:48
1.http原理 1.1 URL和URI URL: 统一资源定位符 URI: 统一资源标识符 URI是URL的父类,URI还有一个子类叫做URN(统一资源名称),URN只命名资源,而不指定如何定位资源,所以URN用的非常少,几乎所有的URI都是URL 1.2 超文本:网页的源代码HTML就可以称之为超文本 1.3 HTTP 超文本传输协议(应用层) 用于从网络文本数据到本地浏览器的传送协议 一个HTTP的操作称之为一个事物,分为四个步骤 (1)客户端与服务器端建立连接 (2)建立连接以后,客户端向服务器端发送一个请求(request) 请求:包括请求的方法,请求的网址(URL)请求头 请求体 请求体:一般承载的都是post请求的表单数据,get请求的请求体为空 (3)服务器端接收到请求后,给与响应(response) ,格式是一个状态行 响应(response) 包括响应的状态码, 响应头, 响应体 响应体: 响应的正文数据都在响应体中,请求网页时,它的响应体就是网页的HTML代码 (4)断开连接 HTTPS: 是以安全为目标的HTTP通道,简单来说就是HTTP的安全版,即HTTP下加入了SSL层,简称HTTPS,HTTPS的安全基础是SSL,因此通过它传送到内容都是经过SSL加密的。 1.4 请求方法(GET , POST) 1.4.1 get :在浏览器中 直接输入URL并回车

Add cookies to retrofit 2 request

半城伤御伤魂 提交于 2020-04-07 17:43:01
问题 I need to add cookies with retrofit 2.0. If i understand correct, cookies - the same as headers. this cookies must be added: private HashMap<String, String> cookies = new HashMap(); cookies.put("sessionid", "sessionId"); cookies.put("token", "token"); this one work with Jsoup lib: String json = Jsoup.connect(apiURL + "/link") .cookies(cookies) .ignoreHttpErrors(true) .ignoreContentType(true) .execute() .body(); here is my code with retrofit request: @GET("link") Call<CbGet> getData(@Header(

Add cookies to retrofit 2 request

a 夏天 提交于 2020-04-07 17:41:27
问题 I need to add cookies with retrofit 2.0. If i understand correct, cookies - the same as headers. this cookies must be added: private HashMap<String, String> cookies = new HashMap(); cookies.put("sessionid", "sessionId"); cookies.put("token", "token"); this one work with Jsoup lib: String json = Jsoup.connect(apiURL + "/link") .cookies(cookies) .ignoreHttpErrors(true) .ignoreContentType(true) .execute() .body(); here is my code with retrofit request: @GET("link") Call<CbGet> getData(@Header(

Not able to read Set-Cookie response header

佐手、 提交于 2020-04-07 07:54:28
问题 Here is my api call, I am trying to read Set-Cookie from response header return $http(config).then(function (response) { console.log(response.headers('Set-Cookie')); // undefined console.log($cookies.ovrcMfa); // undefined return response.data; }); and response header is: Access-Control-Allow-Credentials: true Access-Control-Allow-Headers: Content-Type, Authorization, Set-Cookie, X-Requested-With, X-Session-Id, X-App-version, X-Target-Client, X-Origin-Domain, X-Dev-Mode Access-Control-Allow

Not able to read Set-Cookie response header

寵の児 提交于 2020-04-07 07:54:09
问题 Here is my api call, I am trying to read Set-Cookie from response header return $http(config).then(function (response) { console.log(response.headers('Set-Cookie')); // undefined console.log($cookies.ovrcMfa); // undefined return response.data; }); and response header is: Access-Control-Allow-Credentials: true Access-Control-Allow-Headers: Content-Type, Authorization, Set-Cookie, X-Requested-With, X-Session-Id, X-App-version, X-Target-Client, X-Origin-Domain, X-Dev-Mode Access-Control-Allow

How to store array cookie in laravel 5.4?

我的未来我决定 提交于 2020-04-06 22:16:06
问题 I have this function in laravel 5.4 but I get error. $cart[$product->id] = $quantity; var_dump($cart); return redirect('catalogs')->withCookie(cookie()->forever('cart', $cart)); var_dump($cart) contains this: array(1) { [1]=> string(1) "1" } Error warning: Method Symfony\Component\HttpFoundation\Cookie::__toString() must not throw an exception, caught ErrorException: Array to string conversion If I passed just string value (not array), it success. If there any way to store array cookie in