- Timestamp:
- Mar 14, 2023 7:01:46 PM (14 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/App.inc.php
r785 r786 1837 1837 1838 1838 /* 1839 * Delete a cookie previously created by setCookie(). 1839 * Delete a cookie previously created by setCookie(). The same function arguments must be used to unset a cookie as were used to set it. 1840 1840 * 1841 1841 * @access public 1842 1842 * @param string $name The name of the cookie. 1843 * @param string $path The path on the server in which the cookie will be available on. 1844 * @param string $domain The domain that the cookie is available to. 1845 * @param bool $secure Indicates that the cookie should only be transmitted over a secure HTTPS connection from the client. 1846 * @param bool $httponly When TRUE the cookie will be made accessible only through the HTTP protocol (makes cookies unreadable to javascript). 1847 * @param string $samesite Value of the SameSite key ('None', 'Lax', or 'Strict'). PHP 7.3+ only. 1843 1848 * @return bool True on success, false on error. 1844 1849 * @author Quinn Comendant <quinn@strangecode.com> 1845 1850 * @since 14 Mar 2023 12:12:15 1846 1851 */ 1847 public function unsetCookie($name) 1848 { 1849 $ret = setcookie($name, '', 1); 1850 if (false === $ret) { 1851 $this->logMsg(sprintf('Failed to unset cookie (%s) probably due to output before headers.', $name), LOG_NOTICE, __FILE__, __LINE__); 1852 } 1853 return $ret; 1852 public function unsetCookie($name, $path='/', $domain=null, $secure=null, $httponly=null, $samesite=null) 1853 { 1854 return $this->setCookie($name, '', 1, $path, $domain, $secure, $httponly, $samesite); 1854 1855 } 1855 1856
Note: See TracChangeset
for help on using the changeset viewer.