cookies

Chrome localhost cookies not being set

吃可爱长大的小学妹 提交于 2020-07-22 10:12:15
问题 I'm setting up ASP.NET Core authentication in different configurations, using Google Chrome as a development and test tool. Everything worked fine locally, but suddenly it stopped. I've inspected the http headers and I found Set-Cookie one there in my POST response, but nothing in the next request nor in the Application->Storage->Cookies tab. I've inspected the console and found no errors nor warnings there. I've restated and updated Chrome (with no effect) and finally switched to Edge and

Setting cookie for different domain from javascript

吃可爱长大的小学妹 提交于 2020-07-21 05:20:25
问题 I am trying to set cookie to domain same as src of js file. Scenario: In www.xyz.com html, I have included js file from qwe.com as below <script type="application/javascript" src="http://qwe.com/b.js"></script> From this b.js, i want to create cookie with domain set to .qwe.com. I am setting cookie with following function function createCookie(name, value, days) { if (days) { var date = new Date(); date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); var expires = "; expires=" + date

Setting cookie for different domain from javascript

时光总嘲笑我的痴心妄想 提交于 2020-07-21 05:19:50
问题 I am trying to set cookie to domain same as src of js file. Scenario: In www.xyz.com html, I have included js file from qwe.com as below <script type="application/javascript" src="http://qwe.com/b.js"></script> From this b.js, i want to create cookie with domain set to .qwe.com. I am setting cookie with following function function createCookie(name, value, days) { if (days) { var date = new Date(); date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); var expires = "; expires=" + date

setcookie with expire=0 does not expire after the browser closes

一世执手 提交于 2020-07-18 19:01:04
问题 I use setcookie to make a cookie with expire=0. From the PHP document, (link) The time the cookie expires. This is a Unix timestamp so is in number of seconds since the epoch. In other words, you'll most likely set this with the time() function plus the number ?of seconds before you want it to expire. Or you might use mktime(). time()+60*60*24*30 will set the cookie to expire in 30 days. If set to 0, or omitted, the cookie will expire at the end of the session (when the browser closes). My

setcookie with expire=0 does not expire after the browser closes

南楼画角 提交于 2020-07-18 18:58:28
问题 I use setcookie to make a cookie with expire=0. From the PHP document, (link) The time the cookie expires. This is a Unix timestamp so is in number of seconds since the epoch. In other words, you'll most likely set this with the time() function plus the number ?of seconds before you want it to expire. Or you might use mktime(). time()+60*60*24*30 will set the cookie to expire in 30 days. If set to 0, or omitted, the cookie will expire at the end of the session (when the browser closes). My

Programmatically set browser cookie (Firefox)

我的未来我决定 提交于 2020-07-18 05:37:10
问题 I know from this question that Firefox 3.0 and up stores its cookies in an SQLite database. My question is: can you access this database from other desktop programs in such a way that you could add a cookie? I realize this has security implications. However, I do not want to read them at all. I want to be able to set one cookie if possible. I don't even want to overwrite a cookie. I just want to add it if it isn't there already. This is sort of a personal project I'm working on for fun. This

What is the JavaScript equivalent of “Clear Site Data” in Chrome Dev Tools?

余生颓废 提交于 2020-07-18 03:44:32
问题 I am looking for a way to trigger the same behavior as "Clear site data" in Chrome Dev tools or as close to the same behavior as possible. I know there are some things that are not possible i.e. clearing browser cache, and this doesn't need to be within the scope of this question. I am not sure if Clear Site Data does some special things other than clearing cookies, Web SQL/IndexedDB and unregistering service workers. I use localForage in some of the projects I work on so cleaning IndexedDB

How do I set a cookie with a (ruby) rack middleware component?

自闭症网瘾萝莉.ら 提交于 2020-07-17 05:41:35
问题 I'm writing a rack middleware component for a rails app that will need to conditionally set cookies. I am currently trying to figure out to set cookies. From googling around it seems like this should work: class RackApp def initialize(app) @app = app end def call(env) @status, @headers, @response = @app.call(env) @response.set_cookie("foo", {:value => "bar", :path => "/", :expires => Time.now+24*60*60}) [@status, @headers, @response] end end which doesn't give errors, but doesn't set a cookie

difference between cookie and string in request header

一个人想着一个人 提交于 2020-07-08 09:39:22
问题 Cookie is nothing but a small piece of information most of the times a string in the request header send by the client to server. If i add one more string to the request header at server in java like conn.addRequestProperty("iPlanetDirectoryPro", token); then is there any difference between the two? Can the second one be also considered as a cookie. Regards, Maclean Maurice Pinto 回答1: You'll want to read the HTTP specification (message headers) and the HTTP State Management specification. The

difference between cookie and string in request header

前提是你 提交于 2020-07-08 09:39:16
问题 Cookie is nothing but a small piece of information most of the times a string in the request header send by the client to server. If i add one more string to the request header at server in java like conn.addRequestProperty("iPlanetDirectoryPro", token); then is there any difference between the two? Can the second one be also considered as a cookie. Regards, Maclean Maurice Pinto 回答1: You'll want to read the HTTP specification (message headers) and the HTTP State Management specification. The