none
Would Invoke-WebRequest keep cookies? RRS feed

  • General discussion

  • I would like to know on whether cookies would be kept or not, when connection is made by PowerShell a shown below:

    (Invoke-WebRequest -Uri $url -SessionVariable Y -UseBasicParsing).Content

    Does anyone have any suggestions?
    Thanks in advance for any suggestions


    Thanks in advance for any suggestions

    • Changed type Bill_Stewart Monday, March 19, 2018 5:46 PM
    • Moved by Bill_Stewart Monday, March 19, 2018 5:46 PM Help vampire
    Friday, February 16, 2018 12:44 PM

All replies

  • Yes.  Cookies are in the "CookieContainer".

    $ww = Invoke-WebRequest http://www.google.com
    $ww.BaseResponse.Cookies


    \_(ツ)_/


    • Edited by jrv Friday, February 16, 2018 1:19 PM
    Friday, February 16, 2018 1:17 PM
  • Yes.  Cookies are in the "CookieContainer".

    $ww = Invoke-WebRequest http://www.google.com
    $ww.BaseResponse.Cookies


    Why are there 2 comments from Cookies as shown below image?

    Is one connection making 2 different requests with different cookies?

    Which variables are actually stored cookies's information? Name or Value

    Do you have any suggestions?
    Thank you very much for any suggestions (^v^)


    Thanks in advance for any suggestions


    Friday, February 16, 2018 1:49 PM
  • Learn to use the system documentation when learning new objects: https://msdn.microsoft.com/en-us/library/system.net.cookie(v=vs.110).aspx


    \_(ツ)_/

    Friday, February 16, 2018 1:56 PM
  • If Google keeps tracks on what I search, I would like to know on where searching records are stored, do it keep on cookies on local PC? or do it keep on Web server based on Name and Value?

    Name = Gets or sets the name for the Cookie.
    Value = Gets or sets the Value for the Cookie.

    Do you have any suggestions?
    Thank you very much for any suggestions (^v^)


    Thanks in advance for any suggestions

    Friday, February 16, 2018 2:28 PM
  • It all comes from  the web server.  What you are seeing is what the search engine suggests as possible terms merged with some items you may have typed.  Your cookie tells the server where your data is.

    Post in the Google developer forum for access to an API that can access much of this information on Google from code.


    \_(ツ)_/

    Friday, February 16, 2018 2:33 PM
  • Base on different search record from Cookies, Name variable keeps the same, but the value are different.

    If I search "Table" and search "TV" on google and the Name variable is 1P_JAR or NID (SAME) with (DIFFERENT) values variable, those records would be transferred to Google's Web Server for records, would it be correct?

    Based on given image, I would like to know on what kind of cookies is that

    Cookies, Sessions, or Persistence

    Do you have any suggestions?
    Thank you very much for any suggestions (^v^)


    Thanks in advance for any suggestions

    Friday, February 16, 2018 2:47 PM
  • This is not a web development/Google API support forum.


    -- Bill Stewart [Bill_Stewart]

    Friday, February 16, 2018 3:07 PM
  • I would like to know on how to retrieve the specific name "NID" from cookies under PowerShell.

    Do you have any suggestions?
    Thanks, to everyone very much for any suggestions (^v^)


    Thanks in advance for any suggestions

    Friday, February 16, 2018 3:25 PM
  • I refer the honorable gentleman to the answers already given some moments ago.

    -- Bill Stewart [Bill_Stewart]

    Friday, February 16, 2018 3:33 PM
  • $ww.BaseResponse.Cookies.name would return 1P_JAR and NID, but I would like to only retrieve specific one and return NID.


    Do you have any suggestions?
    Thank you very much for any suggestions (^v^)



    Thanks in advance for any suggestions

    Friday, February 16, 2018 4:30 PM
  • This is answered by learning the basics of PowerShell.

    You can filter for a specific object using the Where-Object cmdlet.

    Type this command at the PowerShell prompt and read the help information:


    help Where-Object -full

    We are not able to help you with step-by-step basic training in a forum. That is not the purpose of this forum.


    -- Bill Stewart [Bill_Stewart]

    Friday, February 16, 2018 6:07 PM
  • When I run following coding, it filters and get 1 result, but how to retrieve the name within this result?

    $ww.BaseResponse.Cookies | where-object { $_.HttpOnly -eq True }

    I try following coding without luck.

    $ww.BaseResponse.Cookies.Name | where-object { $_.HttpOnly -eq True }

    Do you have any suggestions?
    Thanks, to everyone very much for any suggestions (^v^)


    Thanks in advance for any suggestions

    Friday, February 16, 2018 8:56 PM
  • You need to use $true, not True.

    Again: You need to invest some time and actually learn how to use PowerShell.

    Posting messages in a forum is quite possibly the most inefficient way possible to learn any technology.


    -- Bill Stewart [Bill_Stewart]

    Friday, February 16, 2018 9:07 PM
  • Thanks, to everyone very much for any suggestions (^v^)

    Thanks in advance for any suggestions

    Friday, February 16, 2018 9:50 PM