setcookie

Cookie set on root domain not available to subdomain - what am I doing wrong?

戏子无情 提交于 2021-02-11 15:14:29
问题 Client hosted on subdomain.example.com makes api call to example.com to fetch a cookie. The response has a Set-cookie header and I see the cookie as being returned alright: However, I don't see the cookie saved in the Browser (Chrome, Firefox, Edge) and, as a result, is not sent as a header in subsquent API requests: Set-cookie domain attribute is set to .example.com , but as I read in MDN I think the trailing dot gets ignored. The cookie in question, by the way, is the csrf token secret set

Angular Universal set set-cookies in request header

℡╲_俬逩灬. 提交于 2021-02-11 14:22:33
问题 I have anngular Universal SSR application with authentication. I save auth token inside http cookies(set-cookies). Now when I refresh application I see unauthenticated page at first, and after a second it converts to authenticated state. I understand that this happens because Universals renderer server doesn't pass token from cookies to API when rendering page. So how can I force Universal server to render page in authenticated state? 回答1: Angular universal does not transfer cookies when

setting cookie through foreach loop inside while loop

非 Y 不嫁゛ 提交于 2021-02-11 14:15:57
问题 I am getting an error while trying to set these cookies through a foreach loop inside a while loop . The error I am getting is .... Notice: A non well formed numeric value encountered in php script: while($row = mysql_fetch_array($sql)){ $path = "/"; $expire = time() + 2592000; $expire = date("Y-m-d h:i:s",$expire); $c = array( md5('id')=>$row['id'], md5('name')=>$row['u'], md5('sex')=>$row['s'], md5('country')=>$row['co'], md5('state')=>$row['st'], md5('city')=>$row['ci'], md5('timezone')=>

Cannot remove a cookie - Firefox rejecting cookies from the past

≡放荡痞女 提交于 2021-01-04 07:22:39
问题 I'm losing my mind here - I'm looking into an issue where some signout functionality in an application I have isn't working because the authentication cookie is not being cleared. The thing is that our "signout" endpoint does include the appropriate set-cookie header in the response - here's what I get looking at the raw response in Firefox: set-cookie: Auth.myapp=; domain=app.mydomain.com; expires=Thu, 26-Nov-2020 13:19:20 GMT; path=/; secure; HttpOnly Firefox is reporting this error in the

Cannot remove a cookie - Firefox rejecting cookies from the past

穿精又带淫゛_ 提交于 2021-01-04 07:21:35
问题 I'm losing my mind here - I'm looking into an issue where some signout functionality in an application I have isn't working because the authentication cookie is not being cleared. The thing is that our "signout" endpoint does include the appropriate set-cookie header in the response - here's what I get looking at the raw response in Firefox: set-cookie: Auth.myapp=; domain=app.mydomain.com; expires=Thu, 26-Nov-2020 13:19:20 GMT; path=/; secure; HttpOnly Firefox is reporting this error in the

I can't set cookie on localhost

时光毁灭记忆、已成空白 提交于 2020-12-12 03:18:48
问题 I'm using NodeJS with the Express framework with the cookie-parser middleware on localhost:3333. My frontend is served by react dev server on localhost:3000. This is my first attempt at anything to do with cookies. Here are the options i set for my cookie: { expires: maxAge , httpOnly: true, sameSite: 'none', secure: true, domain: null } . I've also tried with and without the sameSite, httpOnly and secure options. As well as domain=localhost. Here is a header from the http response i get when

I can't set cookie on localhost

99封情书 提交于 2020-12-12 03:18:09
问题 I'm using NodeJS with the Express framework with the cookie-parser middleware on localhost:3333. My frontend is served by react dev server on localhost:3000. This is my first attempt at anything to do with cookies. Here are the options i set for my cookie: { expires: maxAge , httpOnly: true, sameSite: 'none', secure: true, domain: null } . I've also tried with and without the sameSite, httpOnly and secure options. As well as domain=localhost. Here is a header from the http response i get when

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

This set-cookie was not stored due to user preference

谁都会走 提交于 2020-07-08 12:44:12
问题 I have set a cookie from an api and returned it as a response. But the latest version of chrome beta is not letting me to store the cookie. I have also set the SameSite="None" and Secure for considering third party cookies. But this is not getting stored. https://i.stack.imgur.com/H3Ov3.png 回答1: Check chrome://settings/content/cookies . You want to ensure that: "Allow sites to save and read cookie data (recommended)" is enabled "Block third-party cookies" is disabled Check the other settings

This set-cookie was not stored due to user preference

旧城冷巷雨未停 提交于 2020-07-08 12:44:06
问题 I have set a cookie from an api and returned it as a response. But the latest version of chrome beta is not letting me to store the cookie. I have also set the SameSite="None" and Secure for considering third party cookies. But this is not getting stored. https://i.stack.imgur.com/H3Ov3.png 回答1: Check chrome://settings/content/cookies . You want to ensure that: "Allow sites to save and read cookie data (recommended)" is enabled "Block third-party cookies" is disabled Check the other settings