Skip to main content

Behat & Mink Cookie Management

You can manipulate cookie of different browser using Behat & Mink.

Three function you can perform on browser cookies:

  • Get Cookie
  • Set Cookie
  • Delete Cookie

Note: Drivers like Sahi that use JavaScript to control the browser, you may be restricted to accessing or setting all cookies except HttpOnly cookies.

Below is the sample code snippet for using cookie function:

// get cookie:
echo $session->getCookie('cookie name');

// set cookie:
$session->setCookie('cookie name', 'value');

// delete cookie:
$session->setCookie('cookie name', null);

behat with mink and drupal extension course on udemy

Submitted by tgoswami on September 7, 2020

Tarun has 11+ years of experience in Quality Assurance in different domains like Banking, E-commerce, Health and Education.


At ProgramsBuzz, you can learn, share and grow with millions of techie around the world from different domain like Data Science, Software Development, QA and Digital Marketing. You can ask doubt and get the answer for your queries from our experts.