在JavaScript中创建cookie的问题

时间:2017-01-28 14:43:15

标签: javascript cookies

我一直在努力创建一个cookie ......

<?php
class Singleton{
    private static $instance = null;

    protected function __construct(array $config = []){
        //do something...
    }

    public static function getInstance(array $config = []){
        $className = get_called_class();
        if (!isset(self::$instance[$className])){
            self::$instance[$className] = new static($config);
        }
        return self::$instance[$className];
    }
}

class likeDB extends Singleton{
    //...
}

function callbackRF($className, $methodName, array $args = [], array $params = []){
    //do something...

    $class = new ReflectionClass($className);

    //throw Exception
    $instance = $class->newInstanceArgs($args);

    //do something ...
}

但每次,我都会在控制台中查看,输出完全是空白的。我使用了错误的语法或其他东西吗?

1 个答案:

答案 0 :(得分:0)

您的语法是正确的。请检查您的浏览器设置和Enable cookies

对于Chrome:

Go to <code>Settings => Show advance settings => Content Settings</code>

对于Firefox:

enter image description here