PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Ovunc Tukenmez   PHP SameSite Cookie Setter   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Auxiliary script
Class: PHP SameSite Cookie Setter
Set cookie values with the SameSite flag enabled
Author: By
Last change:
Date: 4 years ago
Size: 419 bytes
 

Contents

Class file image Download
<?php
require_once 'SameSiteCookieSetter.php';

//set samesite none php cookie
SameSiteCookieSetter::setcookie('samesite_test','testvalue', array('secure' => true, 'samesite' => 'None'));
//SameSiteCookieSetter::setcookie('cookie2','testvalue', array('expires' => time() + 3600, 'httponly' => true, 'secure' => true, 'samesite' => 'None'));

// access cookie value
// echo 'samesite_test:' . $_COOKIE['samesite_test'];