Cygnite - A Modern Toolkit For Web Developers

The Elegant Way of Building Full-Featured Web Applications

Cygnite Dynamic Routing

Cookie

Documentation

Cookie Manager

Getting Cookie Instance

Get your cookie instance to manipulate cookies.
For Example :

  

  use Cygnite\Common\Input\CookieManager\Cookie;

  $cookie = Cookie::create(function ($cookie) 
  {
      return $cookie;
  });  

  Or 

  $cookie = Cookie::create(); 
 
    

Setting Cookie

 

 $cookie->name('foo')
       ->value('bar')
       ->expire('+1 Days')
       ->path('/')
       ->domain('www.cygniteframework.com')
       ->secure(false)
       ->httpOnly(true);

 or

 $cookie = Cookie::create(function ($cookie) 
 {
    $cookie->name('foo')
           ->value('bar')
           ->expire((time()+3600))
           ->path('/')
           ->store();

    return $cookie;
 });


Getting Cookie Value

 

 $cookie->get('foo');

 

Verifying Cookie Existence

 

 $cookie->has('foo');


Destroying Cookie

Destroy unwanted cookies by name.

 

  $cookie->destroy('foo');

  
Follow Us On Facebook Twitter Google+ Linkedin
Released Under The MIT Public License. Copyrights @2012-2017. Powered by- Sanjoy Dey Productions.