-
Notifications
You must be signed in to change notification settings - Fork 834
setcookie: Add note regarding SameSite=None and disabled Secure behavior #4916
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
TimWolla
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Girgias might have markup opinions here?
Girgias
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed I have some markup notes, the wrapping para is very much unnecessary and please use <simpara> and fix the above note at the same time :)
|
In this case fixing this instance would have created an inconsistency with the markup across rest of this file, so I've reviewed the whole file to make it consistent. |
Girgias
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay, but going throught the file just brings to light more issues :/
| You may notice the <parameter>expires_or_options</parameter> parameter takes on a | ||
| Unix timestamp, as opposed to the date format <literal>Wdy, DD-Mon-YYYY | ||
| HH:MM:SS GMT</literal>, this is because PHP does this conversion | ||
| internally. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While at it could you rewrite this to get rid of the personalization (i.e. using "you") in accordance with the manual style guide.
| </note> | ||
| <note> | ||
| <simpara> | ||
| If <literal>samesite</literal> is <literal>None</literal> then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe as it is a string?
| If <literal>samesite</literal> is <literal>None</literal> then | |
| If <literal>samesite</literal> is <literal>"None"</literal> then |
| <para> | ||
| </programlisting> | ||
| </example> | ||
| <simpara> | ||
| Note that the value portion of the cookie will automatically be | ||
| urlencoded when you send the cookie, and when it is received, it | ||
| is automatically decoded and assigned to a variable by the same | ||
| name as the cookie name. If you don't want this, you can use | ||
| <function>setrawcookie</function> instead. To see | ||
| the contents of our test cookie in a script, simply use one of the | ||
| following examples: | ||
| </para> | ||
| <para> | ||
| <informalexample> | ||
| <programlisting role="php"> | ||
| <![CDATA[ | ||
| </simpara> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personalization, but also maybe this should also be in a <note> tag?
| <programlisting role="php"> | ||
| <![CDATA[ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| <programlisting role="php"> | |
| <![CDATA[ | |
| <programlisting role="php"> | |
| <![CDATA[ |
| When deleting a cookie you should assure that the expiration date | ||
| is in the past, to trigger the removal mechanism in your browser. | ||
| Examples follow how to delete cookies sent in previous example: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personalization
| <programlisting role="php"> | ||
| <![CDATA[ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| <programlisting role="php"> | |
| <![CDATA[ | |
| <programlisting role="php"> | |
| <![CDATA[ |
| You may also set array cookies by using array notation in the | ||
| cookie name. This has the effect of setting as many cookies as | ||
| you have array elements, but when the cookie is received by your | ||
| script, the values are all placed in an array with the cookie's | ||
| name: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personalization
| You can use output buffering to send output prior to the | ||
| call of this function, with the overhead of all of your output to the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personalization
| <simpara> | ||
| The following examples demonstrate some ways to send cookies. | ||
| <example> | ||
| <title><function>setcookie</function> send example</title> | ||
| <programlisting role="php"> | ||
| <![CDATA[ | ||
| </simpara> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this paragraph even useful?
| <example> | ||
| <title><function>setcookie</function> send example</title> | ||
| <programlisting role="php"> | ||
| <![CDATA[ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And quite a few other places do this
| <![CDATA[ | |
| <![CDATA[ |
Fixes #4873