Link to home
Create AccountLog in
Avatar of rgb192
rgb192Flag for United States of America

asked on

use curl to go to page3 (if cookie is set)

this question is a followup to
https://www.experts-exchange.com/questions/28019735/example-to-test-curl.html
which sets a cookie and logs onto a post form
using curl
takes user from page1 to page2

how can there be an curl example, if cookie is set then go to page
maybe page3 or page4 which are not linked to the page1 logon but are linked to the cookie
ASKER CERTIFIED SOLUTION
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
SOLUTION
Avatar of Brad Brett
Brad Brett
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
cURL works on the server-side, this means that the server is making the request (not the client).
This is both true and untrue, and it's a frequent point of confusion.

It is true that cURL scripts are run on a server, but in the cURL application, the server that makes the request becomes the client in the HTTP client/server model.  The rules still apply: Every request (whether GET or POST) is atomic, complete and stateless, and the server's response is complete and usually instantaneous.  Then the server disconnects and waits for the next action from a client, effectively "forgetting" everything about the previous request. In the HTTP client/server model, the server cannot initiate any action on the client machine.  The server can only respond to requests.
Good clarification Ray :) The main point that I wanted to clarify is that the request is NOT made by the visitor browser client, of course the request can contain any header.
Indeed it can - absolutely any header including a completely bogus referer, browser details, etc.
Avatar of rgb192

ASKER

okay I am reading a basic explanation of the way the code should work

thanks