PHP Classes

File: index.php

Recommend this page to a friend!
  Classes of Muhammad Umer Farooq   PHP Cookie Management Class   index.php   Download  
File: index.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: PHP Cookie Management Class
Store and retrieve HTTP request cookie values
Author: By
Last change: Apply fixes from StyleCI
Date: 5 years ago
Size: 409 bytes
 

Contents

Class file image Download
<?php

//include the required file
require_once 'init.php';

//set_cookie('user','Malik Umer Farooq',3700,'/','localhost',false,false);

//check if cookie set
if (is_cookie('user')) {

   
//get the cookie value
   
echo get_cookie('user');
} else {

   
//set the cookie
   
set_cookie('user', 'Malik Umer Farooq', 3700, '/', 'localhost', false, false);
}

//delete the cookie value
//delete_cookie('user');