|
Posted by Jerry Stuckle on 05/28/06 05:09
julianmlp@gmail.com wrote:
> Jerry Stuckle wrote:
>
>>julianmlp@gmail.com wrote:
>>
>>
>>>What I was wondering is: Is there any (simple/easy) way to hijack a
>>>cookie remotely? (to be afraid of)
>>>
>>
>>Not unless you can intercept the packets somewhere between the server and the
>>client, or have access to the server file system (assuming you are using the
>>default session handler in PHP).
>
>
> I'm not using the default session handler.
>
> I pass the session ID as
>
> url_to_my_file.php?session=VALUE,
>
> where VALUE is created from:
>
> VALUE = md5(uniqid(rand(), true));
>
> CookieValue = sha1(VALUE + HiddenString);
>
>
> When I receive a client request, I lookup for the session AND the
> cookie's value to see whether the client is logged or not.
> It seems to me pretty safe, but I'm not an expert at all...
>
It's not really any safer than just using the default session handler - which,
as I said before, is fairly safe but not foolproof. However, neither is your
method foolproof.
And if you're doing something which requires that much security, you should be
using SSL anyway - in which case the session id is encrypted anyway.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
[Back to original message]
|