<?php
include('./curl.wrapper.php');
$curl = new CCurlWrapper();
if($curl->InitEx() === false)
die('Unable to init the CURL library' . "\n");
$mag_num = 159;
// request
$content_no_cookie = $curl->Exec('http://www.auchan.fr/magasin/recherche/selectMagasin.jsp?selectStore=' . $mag_num);
// cookie's JAR
$curl->SetCookieFile('./cookie.txt');
// use new cookie for every request (the content of the 'cookie.txt' is ignore)
$curl->SetCookieSession(true);
$curl->SetCookie(array('AuchanEM=||||||', 'AuchanFR.shop=' . $mag_num . '||'));
$content_cookie = $curl->Exec('http://www.auchan.fr/magasin/recherche/selectMagasin.jsp?selectStore=' . $mag_num);
// file_put_contents('./content_no_cookie.html', $content_no_cookie);
// file_put_contents('./content_cookie.html', $content_cookie);
// the difference is top left
// "TROUVEZ MON MAGASIN" (Find my store) without cookie
// "MON MAGASIN : GRASSE(changer)" (My store : GRASSE(change) with cookie
?>
|