Reply to Re: CURL ignores $_SESSION???

Your name:

Reply:


Posted by Rik on 02/18/07 16:26

On Sun, 18 Feb 2007 17:02:36 +0100, turnitup <same@same> wrote:

> turnitup wrote:
>> I have a security mechanism that checks that session variables are se=
t, =

>> and if not, redirects. It seems, however, that CURL just ignores this=
=

>> statement and completely breaches my security.
>> Does anyone have any ideas how to avoid this?
>
>
> It seems that CURL ignores the redirect header. I had to put an exit =

> after that statement. Sorted now. CAVEAT REDIRECTOR!!!

Which is why redirecting should actually be done like this:

<?php
$target =3D 'http://example.com';
header("Location: $target");
print("You are being redirected to $target, click <a =

href=3D\"$target\">here</a> if you don't get redirected.");
exit;
?>

NOt only cURL, but all kinds of applications & browsers can choose not t=
o =

directly follow your location headers. If you open pages with cURL, and =
=

you want to obey redirects from the header, use:
curl_setopt($curl,CURLOPT_FOLLOWLOCATION, true);
-- =

Rik Wasmus

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация