I guys.
Have worked around with cookies in PHP for some time. However something came to my mind.
Does its possible to gather all cookies (without knowing its names), or at least list all cookies names present in a browser?
Regards.
I guys.
Have worked around with cookies in PHP for some time. However something came to my mind.
Does its possible to gather all cookies (without knowing its names), or at least list all cookies names present in a browser?
Regards.
No, you can't. php can only locate cookies created from it self host. This security is from browser side.
No, cookies are domain specific. You could get more protection against cookie hijacking by configuring your cookies as HttpOnly, supported in PHP since 5.2.0.
Yes, you can get all the cookies that you have set by:
foreach($_COOKIE as $key => $value)
{
echo $key . " => " . $value;
}
Hope this helps!