Re: CURL and $_SESSION problem

From: Pedro Graca (hexkid_at_hotpop.com)
Date: 07/10/04

  • Next message: Hello World: "Re: PHP/MySQL and Zone Alarm"
    Date: 10 Jul 2004 01:25:43 GMT
    
    

    Phil Powell wrote:
    > Pedro Graca
    >> Have you tried to telnet the scrape.php server?

    > Can't do it, connection refused when I attempt to telnet. :(

    telnet <server> <port>

    If you don't specify the port, it'll default to port 23, which probably
    is closed by the firewall.

    If Mozilla can do it, so can you with telnet!

        telnet www.myotherphpwebsite.com 80
        telnet www.google.com 80 ==> sets cookie, large HTML
        telnet www.barclay.com 80 ==> no cookie, small HTML

    but maybe your telnet does not echo commands. If after you enter telnet
    nothing shows up type (blindly) "GET / HTTP/1.0<ENTER><ENTER>"

    > That still is not going to work. Because I would need to set-cookie
    > the PHPSESSID id generated by "index.php" 's server
    > ('www.myotherphpwebsite.com'), which I can't retrieve because it
    > simply won't let me do so via telnet.

    The cookie keeps changing ... for every new connection that doesn't
    carry the old cookie, the server will generate a new one.

    > Again, I can get my own PHPSESSID but I can't get the REMOTE
    > PHPSESSID, and, even if I could do that:
    >
    > 1) Where will it go using CURL?

    Let's assume you got the cookie and have it saved in $scraped_cookie.
    Precede next curl_exec() call with

        curl_setopt($ch, CURLOPT_COOKIE, $scraped_cookie);

    This $scraped_cookie will be something like
    "PHPSESSID=0123456789abcdeffedcba9876543210"
    (without the quotes, of course), with no spaces before or after, with no
    semi-colons anywhere, with no line breaks.

    > 2) If I put it with the rest of the cookie stuff to go via
    > CURLOPT_COOKIE, again, Mozilla Firefox will lock up and produce a
    > page-download infinite loop every time I tried even forcing $PHPSESSID
    > into the cookie "query string" that is to be placed into the CURL
    > resource HTTP header.

    It shouldn't. Maybe you have an infinite loop in your script.

    -- 
    USENET would be a better place if everybody read:   | to email me: use |
    http://www.catb.org/~esr/faqs/smart-questions.html  | my name in "To:" |
    http://www.netmeister.org/news/learn2quote2.html    | header, textonly |
    http://www.expita.com/nomime.html                   | no attachments.  |
    

  • Next message: Hello World: "Re: PHP/MySQL and Zone Alarm"

    Relevant Pages

    • Re: IIS and SBS 2003
      ... I have a new sbs2003 install and if I telnet to localhost ... port 80, and type hhh and hit enter it returns a HTTP/1.1 400 Bad ... "broken" sbs server, it connects but then dumps me. ... If I http to localhost, companyweb or anything I get Cannot Find ...
      (microsoft.public.windows.server.sbs)
    • Re: RDP access to SBS 2003 - HELP please
      ... Might I add that 'out of the box', when I first got the server it worked ... of it to the telnet prompt and quit. ... Try the remote desktop connection to see if it works. ... the effect that it can't connect to xxx.xxx.xxx.xxx port 23. ...
      (microsoft.public.windows.server.sbs)
    • Re: IP Blocker in SBS2003 exchange
      ... > What I was trying to explain in the telnet section was that I realise ... > the server is listening for connections on ports 110 and 25. ... > but he can connect to port 110. ... > well as another wireless broadband connection. ...
      (microsoft.public.windows.server.sbs)
    • Re: User access form remote Site ove managed VPN
      ... I think you have the syntax wrong in your telnet command. ... If you try and use a colon, it defaults to port 23 which is why you got ... the basic directions for implementing a terminal server on SBS2003 domain. ... managed VPN link between remote sites and headoffice. ...
      (microsoft.public.windows.terminal_services)
    • Re: Cookies not being sent by IIS
      ... Try PuTTY for telnet. ... >>Temporary Internet Folders and look for the downloaded cookie. ... >>first server, the cookie shows up in the Temporary Internet Folders. ... >>I will test telnetting to port 80. ...
      (microsoft.public.inetserver.iis.activeserverpages)