summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMouad Err <mouad@tousfacteurs.com>2022-06-21 15:15:11 +0200
committerMouad Err <mouad@tousfacteurs.com>2022-06-21 15:15:11 +0200
commitca00ea86443d2b1563b0e1b51ce8225bd315e69e (patch)
tree634789346d032c12a26651ce8dad046a4e34dbe6
parent87f9ac6ca2eb125f5991243865e7e5e96fd3987b (diff)
Bug Fix: [cookie_helper.php] set_cookie was missing sameSite argument
-rw-r--r--system/helpers/cookie_helper.php4
-rw-r--r--user_guide_src/source/helpers/cookie_helper.rst3
2 files changed, 4 insertions, 3 deletions
diff --git a/system/helpers/cookie_helper.php b/system/helpers/cookie_helper.php
index 2ea9c2901..0325e3db3 100644
--- a/system/helpers/cookie_helper.php
+++ b/system/helpers/cookie_helper.php
@@ -68,10 +68,10 @@ if ( ! function_exists('set_cookie'))
* @param bool true makes the cookie accessible via http(s) only (no javascript)
* @return void
*/
- function set_cookie($name, $value = '', $expire = 0, $domain = '', $path = '/', $prefix = '', $secure = NULL, $httponly = NULL)
+ function set_cookie($name, $value = '', $expire = 0, $domain = '', $path = '/', $prefix = '', $secure = NULL, $httponly = NULL, $samesite = NULL)
{
// Set the config file options
- get_instance()->input->set_cookie($name, $value, $expire, $domain, $path, $prefix, $secure, $httponly);
+ get_instance()->input->set_cookie($name, $value, $expire, $domain, $path, $prefix, $secure, $httponly, $samesite);
}
}
diff --git a/user_guide_src/source/helpers/cookie_helper.rst b/user_guide_src/source/helpers/cookie_helper.rst
index 25c4c3a0b..741b297d6 100644
--- a/user_guide_src/source/helpers/cookie_helper.rst
+++ b/user_guide_src/source/helpers/cookie_helper.rst
@@ -25,7 +25,7 @@ Available Functions
The following functions are available:
-.. php:function:: set_cookie($name[, $value = ''[, $expire = 0[, $domain = ''[, $path = '/'[, $prefix = ''[, $secure = NULL[, $httponly = NULL]]]]]]])
+.. php:function:: set_cookie($name[, $value = ''[, $expire = 0[, $domain = ''[, $path = '/'[, $prefix = ''[, $secure = NULL[, $httponly = NULL[, $samesite = NULL]]]]]]]])
:param mixed $name: Cookie name *or* associative array of all of the parameters available to this function
:param string $value: Cookie value
@@ -35,6 +35,7 @@ The following functions are available:
:param string $prefix: Cookie name prefix
:param bool $secure: Whether to only send the cookie through HTTPS
:param bool $httponly: Whether to hide the cookie from JavaScript
+ :param string $samesite: SameSite attribute ('Lax', 'Strict', 'None')
:rtype: void
This helper function gives you friendlier syntax to set browser