bo włączam ff i potem daje pokaż ciacha i jest tylko jedno a tego co przesyłam tym wyżej to nie ma.
mam taki kto który zastepuje mi follow location
function curl_redirect_exec($ch, &$redirects, $curlopt_returntransfer = false, $curlopt_maxredirs = 4, $curlopt_header = false) {
$cookie = dirname(__FILE__) .'/cookie'; curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie );
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie );
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, 'username=kubek&password=xxx&submitlogin=Zaloguj');
$data = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$exceeded_max_redirects = $curlopt_maxredirs > $redirects;
$exist_more_redirects = false;
if ($http_code == 301 || $http_code == 302) {
if ($exceeded_max_redirects) {
list
($header) = explode("\r\n\r\n", $data, 2
); preg_match('/(Location:|URI:)(.*?)\n/', $header, $matches); if (isset($url_parsed)) { curl_setopt($ch, CURLOPT_URL, $url);
$redirects++;
return curl_redirect_exec($ch, $redirects, $curlopt_returntransfer, $curlopt_maxredirs, $curlopt_header);
}
}
else {
$exist_more_redirects = true;
}
}
if ($data !== false) {
if (!$curlopt_header)
list
(,$data) = explode("\r\n\r\n", $data, 2
); if ($exist_more_redirects) return false;
if ($curlopt_returntransfer) {
return $data;
}
else {
if (curl_errno($ch) === 0) return true;
else return false;
}
}
else {
return false;
}
}
i zaloguje sie nim na stronę ale jak patrze w ciastka to wysle się tylko id sesji ale nazwa juz się nie wyśle.
Oglądałem to live http i patrzyłem co jest wysyłane.
I ogólnie sa 3 przekierowania
na pierwszym logowaniu dostaje id na drugim dostaje numer , a na trzecim dostaje (chyba nowe id sedji) i ten sam numer.
Jak to odplae w przedlądarce to wyśle sie tylko id sesji. Może cos źle dodałem bo robie to i robie juz kilka h i dalej nic