<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.owasp.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ayesh</id>
		<title>OWASP - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.owasp.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ayesh"/>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php/Special:Contributions/Ayesh"/>
		<updated>2026-04-12T07:23:05Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.27.2</generator>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=SameSite&amp;diff=246074</id>
		<title>SameSite</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=SameSite&amp;diff=246074"/>
				<updated>2018-12-14T20:46:25Z</updated>
		
		<summary type="html">&lt;p&gt;Ayesh: Added information for PHP 7.3 new SameSite cookie support with a link to official PHP.net page and a my own article with more examples.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
SameSite prevents the browser from sending this cookie along with cross-site requests. The main goal is mitigate the risk of cross-origin information leakage. It also provides some protection against cross-site request forgery attacks. Possible values for the flag are &amp;lt;code&amp;gt;lax&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;strict&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;strict&amp;lt;/code&amp;gt; value will prevent the cookie from being sent by the browser to the target site in all cross-site browsing context, even when following a regular link. For example, for a GitHub-like website this would mean that if a logged-in user follows a link to a private GitHub project posted on a corporate discussion forum or email, GitHub will '''not''' receive the session cookie and the user will not be able to access the project.&lt;br /&gt;
&lt;br /&gt;
A bank website however most likely doesn't want to allow any transactional pages to be linked from external sites so the &amp;lt;code&amp;gt;strict&amp;lt;/code&amp;gt; flag would be most appropriate here.&lt;br /&gt;
&lt;br /&gt;
The default &amp;lt;code&amp;gt;lax&amp;lt;/code&amp;gt; value provides a reasonable balance between security and usability for websites that want to maintain user's logged-in session after the user arrives from an external link. In the above GitHub scenario, the session cookie would be allowed when following a regular link from an external website while blocking it in CSRF-prone request methods (e.g. &amp;lt;code&amp;gt;POST&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
As of November 2017 the SameSite attribute is implemented in Chrome, Firefox, and Opera.&lt;br /&gt;
&lt;br /&gt;
[http://php.net/manual/en/function.setcookie.php PHP 7.3] has support for SameSite cookies for [https://ayesh.me/PHP-Samesite-cookies custom cookies and session cookies]. &lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://tools.ietf.org/html/draft-west-first-party-cookies-07&lt;br /&gt;
* https://caniuse.com/#search=samesite&lt;br /&gt;
* http://www.sjoerdlangkemper.nl/2016/04/14/preventing-csrf-with-samesite-cookie-attribute/&lt;/div&gt;</summary>
		<author><name>Ayesh</name></author>	</entry>

	</feed>