Subversion Repositories oidplus

Rev

Rev 1116 | Rev 1340 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1116 Rev 1130
Line 83... Line 83...
83
         * @param string|null $samesite
83
         * @param string|null $samesite
84
         * @param bool $forceInsecure
84
         * @param bool $forceInsecure
85
         * @return void
85
         * @return void
86
         * @throws OIDplusException
86
         * @throws OIDplusException
87
         */
87
         */
88
        public function setcookie(string $name, string $value, int $expires=0, bool $allowJS=false, /*?string*/ $samesite=null, bool $forceInsecure=false) {
88
        public function setcookie(string $name, string $value, int $expires=0, bool $allowJS=false, string $samesite=null, bool $forceInsecure=false) {
89
                $domain = $this->getCookieDomain();
89
                $domain = $this->getCookieDomain();
90
                $path = $this->getCookiePath();
90
                $path = $this->getCookiePath();
91
                $secure = $forceInsecure ? false : OIDplus::isSSL();
91
                $secure = !$forceInsecure && OIDplus::isSSL();
92
                $httponly = !$allowJS;
92
                $httponly = !$allowJS;
93
                if (is_null($samesite)) {
93
                if (is_null($samesite)) {
94
                        $samesite = OIDplus::baseConfig()->getValue('COOKIE_SAMESITE_POLICY', 'Strict');
94
                        $samesite = OIDplus::baseConfig()->getValue('COOKIE_SAMESITE_POLICY', 'Strict');
95
                }
95
                }
96
 
96