Jump to content

Recommended Posts

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.

 

Link to comment
https://forums.phpfreaks.com/topic/162107-solved-curl-creating-cookie/
Share on other sites

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.

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.