Why Same-origin policy isn’t enough to prevent CSRF attacks?

Summary I had a misunderstood concepts about Same-origin policy and CORS that @Bergi, @Neil McGuigan and @SilverlightFox helped me to clarify. First of all, what @Bergi says about SOP does not prevent sending requests. It does prevent a page from accessing results of cross-domain requests. is an important concept. I thought that a browser doesn’t … Read more

Safari doesn’t set Cookie but IE / FF does

It looks like you hit a Safari bug here; you are redirecting any visiting browser to /entry while setting the cookie at the same time, and Safari is ignoring the Set-Cookie header when encountering the 302 HTTP status: $ curl -so /dev/null -D – http://4much.schnickschnack.info/ HTTP/1.1 302 Moved Temporarily Server: nginx/0.7.61 Date: Sun, 19 Jul … Read more

set-cookie header not working

See that Secure string in the cookie? Yeah, me too. But only after a few hours. Make sure you’re accessing your site by SSL (https:// at the beginning of the URL) if you’ve got the Secure flag set. If you’re developing locally and don’t have a cert, make sure you skip that option.

Cookie “PHPSESSID” will be soon treated as cross-site cookie against because the scheme does not match

that was exactly same happening with me. the issue was that, firefox keeps me showing even Cookies of different websites hosted on same URL : “localhost:Port number” stored inside browser memory. In my case, i have two projects configured to run at http://localhost:62601, when i run first project, it saves that cookie in browser memory. … Read more

Preserve cookies / localStorage session across tests in Cypress

To update this thread, there is already a better solution available for preserving cookies (by @bkucera); but now there is a workaround available now to save and restore local storage between the tests (in case needed). I recently faced this issue; and found this solution working. This solution is by using helper commands and consuming … Read more

Send cookies with curl

You can use -b to specify a cookie file to read the cookies from as well. In many situations using -c and -b to the same file is what you want: curl -b cookies.txt -c cookies.txt http://example.com Further Using only -c will make curl start with no cookies but still parse and understand cookies and … Read more

Fixing HttpClient warning “Invalid expires attribute” using fluent API

The default HttpClient has difficulty understanding the latest RFC-compliant headers. Instead of hiding the warning, just switch to a standard cookie spec like this (HttpClient 4.4+): HttpClient httpClient = HttpClients.custom() .setDefaultRequestConfig(RequestConfig.custom() .setCookieSpec(CookieSpecs.STANDARD).build()) .build();

How does Facebook set cross-domain cookies for iFrames on canvas pages?

So the iFrame isn’t actually setting the u cookie for the runwithfriends.appspot.com domain. What Facebook does is it creates a form, <form action=”runwithfriends.appspot.com/…” target=”name_of_iframe” method=”POST”> and uses javascript to submit the form on page load. Since the form’s target is the iframe, it doesn’t reload the page… it just loads the iframe with the POST’s … Read more