<?php

    namespace App\System\Vendor\Basic;

    /*
        ??  beGetCookie = Cookie bilgisini çektirme
        ??  beDeleteCookie = Cookie bilgisini silme
        ??  beCreateCookie = Cookie bilgisini ayarlama
    */

    class beCookie {
        public static function beGetCookie($name = ""){
            return $_COOKIE[$name];
        }
        public static function beDeleteCookie($name = ""){
            self::beCreateCookie($name,"",true,true,BE_TIME-1453);
        }
        public static function beCreateCookie($name = "",$value = "",$secure = false,$http = false,$expire = -1){
            if($expire == -1){
                $expire = BE_TIME+31104000;
            }
            $domain = beGetConfig("domain");
            if($domain == "localhost"){
                $altdomain = "";
            }
            else{
                $altdomain = ".{$domain}";
            }
            setcookie($name,$value,$expire,"/",$altdomain,$secure,$http);
        }
    }
?>