Re: Protecting Commercial PHP Scripts
| From: | Curt Zirzow | Date: | Thu, 28 Oct 2004 15:25:24 +0000 |
| Subject: | Re: Protecting Commercial PHP Scripts | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-200543@lists.php.net to get a copy of this message | ||
* Thus wrote Mark-Walter@t-online.de:
> Hi Dirk,
>
> > I found this one very usefull:
> > http://shiflett.org/php-security.pdf
>
> Nice docu *g*
>
> Does someone use this code out from the
> docu mentioned aboved ?
>
> It work's for me only under Explorer, Netscape
> switch to exit.
>
> #
> # Verify HTTP Header
> #
>
> if (isset($_SESSION['HTTP_USER_AGENT'] ))
> {
> if ($_SESSION['HTTP_USER_AGENT'] !=
> md5($SERVER['HTTP_USER_AGENT']))
> {
> exit;
> }
> }
> else {
> $_SESSION['HTTP_USER_AGENT'] = md5($_SERVER['HTTP_USER_AGENT']);
> }
If your using the same session for IE and netscape, the behaviour
you are experiencing demonstrates how this can prevent session
hijacking. Netscape, using its own session should work fine.
Curt
--
Quoth the Raven, "Nevermore."