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: 11 months ago
Size: 419 bytes


Class file image Download
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'];

For more information send a message to info at phpclasses dot org.