N-Bomb(Nerd) Posted June 14, 2009 Share Posted June 14, 2009 I'm trying to get logged in on a website through a script of mine, however there's a captcha on the login form. Instead of actually logging in I thought it would be possible to "create" the cookie to login in advanced. Where I'm going with this is -- I have the cookie information on my computer from actually logging in to the website. From looking in the firefox cookie manager, is it possible to "recreate" these cookies so curl could use it? The website I'm trying to login to has a total of 5 cookies set on my computer. I can only view the cookies from the firefox cookies manager, so I don't know what kind of file they go in. Quote Link to comment https://forums.phpfreaks.com/topic/162107-solved-curl-creating-cookie/ Share on other sites More sharing options...
.josh Posted June 14, 2009 Share Posted June 14, 2009 you can only use server-side scripting (or even client-side scripting, like js) to grab cookies off the same domain, and even then, you can only operate within the scope of the directory for which it is set. For instance, if you set a cookie with a scope of www.site1.com/folder1/ script running from site2 cannot access it, but even www.site1.com/folder1/folder2/script.php cannot access it. which is how it should be. I do not want random sites being able to grab cookies off other sites. Huge security breech. Quote Link to comment https://forums.phpfreaks.com/topic/162107-solved-curl-creating-cookie/#findComment-855441 Share on other sites More sharing options...
N-Bomb(Nerd) Posted June 14, 2009 Author Share Posted June 14, 2009 I'm not quite sure what you mean there. In theory I'm trying to write a php that will login to a website to perform tasks that much better suited for php to handle instead of me creating some script on my computer. The login form to the website has a captcha which I won't be able to pass. I figured it would be possible to re-create cookies from my computer to use in my script. For example, on my computer I login under the name "Thirst" on "example.com". If I look on my computer, I'll have all the cookies in order to be logged in as "Thirst" on "example.com". I want to take those cookies from my computer, and use the same exact ones in my script.. so then I would be logged in as "Thirst" at "example.com" instead of actually having my php script login. However, I'm stuck as how to take these cookies from my computer and put them in some sort of txt file or document that's usable for curl. Quote Link to comment https://forums.phpfreaks.com/topic/162107-solved-curl-creating-cookie/#findComment-855445 Share on other sites More sharing options...
N-Bomb(Nerd) Posted June 14, 2009 Author Share Posted June 14, 2009 Never mind, I figured this out. It was quite easy.. I just needed to apply some effort. Quote Link to comment https://forums.phpfreaks.com/topic/162107-solved-curl-creating-cookie/#findComment-855504 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.