Extract cookie value created using javascript in another file

I am Lakshmi.Research scholar.I have a doubt in the usage of cookies in javascript.Normally in order to extract the cookie value we have to specify the corresponding cookie name.But I need automatic extraction.If i give a php file in which the cookies are created using javascript,all the cookies in that file should be extracted.Is it possible?

You should be able to simply set it in javascript and get it in PHP using


echo $_COOKIE['cookie_name'];


Thanks for the reply.I need automatic extraction of cookies.The input will be the file name,the output should be the number and name of the cookies in that file.is it possible?

No, that is not possible.

You can use JS to read all the cookies visible in a given folder, if that’s what you want.
I think in PHP it would only be possible if you had an array of all names likely to be used, short of running a time-consuming brute-force search.

How to extract javascript coding from html file?

I have no idea what you mean by that. Please be specific.

To retrieve all cookies for the current page, you can use the “document.cookie” property to get list of key=value pairs separated by semicolon.
is that you are looking for?