prefix() public static method

设置或者获取cookie作用域(前缀)
public static prefix ( string $prefix = '' ) : string | void
$prefix string
return string | void
Exemplo n.º 1
0
 public function testPrefix()
 {
     $this->assertEquals($this->default['prefix'], \think\Cookie::prefix());
     $prefix = '_test_';
     $this->assertNotEquals($prefix, \think\Cookie::prefix());
     \think\Cookie::prefix($prefix);
     $config = $this->ref->getValue();
     $this->assertEquals($prefix, $config['prefix']);
 }