Results 1 to 9 of 9

Thread: Cookie Help

  1. #1
    npm's Avatar
    Join Date
    Dec 2011
    Posts
    780
    Userbars
    14
    Thanks
    735
    Thanked 561 Times in 217 Posts
    Downloads
    84
    Uploads
    3
    Mentioned
    109 Post(s)
    Time Online
    83 d 20 h 16 m
    Avg. Time Online
    37 m
    Rep Power
    12

    Cookie Help

    Background:

    So Im doing some neopets programs again (will upload them soon), they're pretty good IMO.
    Im testing new stuff and I've been using HtmlUnit and Selenium, but im having problems with the cookies.

    Im able to get and save the cookies and Im even able to read them and login in sucessfully with it but for some reason the cookies seems to be expired fast 4-5 page refreshes and I cant login again with them even when the neoremeber cookie has an expiration date of a year or so.

    Im thinking rn that the problem is that Selenium nor HtmlUnit retrieve all the cookies, Im printing them on the console to see what's going on and got the following cookies:



    Im aware that are a few others that are involved but im not getting all of them, but I can login in with these cookies a few times but not for the expiration time of the neoremember cookie. any toughs? do I need all of them to make it work properly? Thanks in advance.
    @Daviid, @Infamous Joe, @Atlas.
    Last edited by npm; 12-22-2016 at 12:04 PM.

  2. #2

    Join Date
    Jul 2012
    Posts
    1,879
    Userbars
    18
    Thanks
    1,619
    Thanked 3,292 Times in 998 Posts
    Downloads
    223
    Uploads
    0
    Mentioned
    469 Post(s)
    Time Online
    132 d 23 h 52 m
    Avg. Time Online
    58 m
    Rep Power
    0
    Quote Originally Posted by hectorvazc View Post
    Background:

    So Im doing some neopets programs again (will upload them soon), they're pretty good IMO.
    Im testing new stuff and I've been using HtmlUnit and Selenium, but im having problems with the cookies.

    Im able to get and save the cookies and Im even able to read them and login in sucessfully with it but for some reason the cookies seems to be expired fast 4-5 page refreshes and I cant login again with them even when the neoremeber cookie has an expiration date of a year or so.

    Im thinking rn that the problem is that Selenium nor HtmlUnit retrieve all the cookies, Im printing them on the console to see what's going on and got the follow cookies:


    Im aware that are a few others that are involved but im not getting all of them, but I can login in with these cookies a few times but not for the expiration time of the neoremember cookie. any toughs? do I need all of them to make it work properly? Thanks in advance.
    @Daviid, @Infamous Joe, @Atlas.
    Can you send me a snippet of the code that logins, and browses some random pages? I'll see what I can find.

    Edit:
    It's weird that you don't get PHPSESSID. There's also another cookie that's like random letters and numbers, I always get the same so it should be important.
    Last edited by Daviid; 12-22-2016 at 12:12 PM.

  3. The Following User Says Thank You to Daviid For This Useful Post:

    npm (12-22-2016)

  4. #3
    npm's Avatar
    Join Date
    Dec 2011
    Posts
    780
    Userbars
    14
    Thanks
    735
    Thanked 561 Times in 217 Posts
    Downloads
    84
    Uploads
    3
    Mentioned
    109 Post(s)
    Time Online
    83 d 20 h 16 m
    Avg. Time Online
    37 m
    Rep Power
    12
    Quote Originally Posted by Daviid View Post
    Can you send me a snippet of the code that logins, and browses some random pages? I'll see what I can find.


    Have the code at home, im at work right now but wrote that pseudo as I remember my code.

    EDIT: It might be the PHPSESSID not sure why its not been retrieve by neither of the two API.
    Last edited by npm; 12-22-2016 at 12:44 PM.

  5. #4

    Join Date
    Jul 2012
    Posts
    1,879
    Userbars
    18
    Thanks
    1,619
    Thanked 3,292 Times in 998 Posts
    Downloads
    223
    Uploads
    0
    Mentioned
    469 Post(s)
    Time Online
    132 d 23 h 52 m
    Avg. Time Online
    58 m
    Rep Power
    0
    Quote Originally Posted by hectorvazc View Post


    Have the code at home, im at work right now but wrote that pseudo as I remember my code.

    EDIT: It might be the PHPSESSID not sure why its not been retrieve by neither of the two API.
    Seems good to me, if you can send me the code later I'll try monitoring with Charles Proxy to see what's going on.

  6. The Following User Says Thank You to Daviid For This Useful Post:

    npm (12-22-2016)

  7. #5
    Accelerator's Avatar
    Join Date
    Jul 2013
    Posts
    4,893
    Userbars
    26
    Thanks
    1,986
    Thanked 3,657 Times in 1,585 Posts
    Downloads
    178
    Uploads
    0
    Mentioned
    743 Post(s)
    Time Online
    335 d 1 h 18 m
    Avg. Time Online
    2 h 40 m
    Rep Power
    22
    Haven't tested which are the exact cookies needed for a session to "keep-alive" (LOL) but these are the ones I use:

    You're missing two of 'em and I doubt the toolbar one is relevant from the ones in the spoiler.
    There's one that changes its value every time you refresh or visit a page (can't remember which one it is right now though e_e)

  8. The Following 2 Users Say Thank You to Accelerator For This Useful Post:

    Daviid (12-22-2016),npm (12-22-2016)

  9. #6
    npm's Avatar
    Join Date
    Dec 2011
    Posts
    780
    Userbars
    14
    Thanks
    735
    Thanked 561 Times in 217 Posts
    Downloads
    84
    Uploads
    3
    Mentioned
    109 Post(s)
    Time Online
    83 d 20 h 16 m
    Avg. Time Online
    37 m
    Rep Power
    12
    Ok so after a test from what @accelerator said, I found that I needed to just visit another page before saving the cookies.

    and the cookie that changes every time is: npuid/

    so everything working fine now. thanks @Daviid for your help too, will rep you both.


    EDIT: You must spread some Reputation around before giving it to Accelerator again. Remember me to do it later dude.
    Last edited by npm; 12-22-2016 at 04:02 PM.

  10. The Following 2 Users Say Thank You to npm For This Useful Post:

    Accelerator (12-22-2016),Daviid (12-22-2016)

  11. #7
    Accelerator's Avatar
    Join Date
    Jul 2013
    Posts
    4,893
    Userbars
    26
    Thanks
    1,986
    Thanked 3,657 Times in 1,585 Posts
    Downloads
    178
    Uploads
    0
    Mentioned
    743 Post(s)
    Time Online
    335 d 1 h 18 m
    Avg. Time Online
    2 h 40 m
    Rep Power
    22
    @hectorvazc dw about it man

  12. The Following User Says Thank You to Accelerator For This Useful Post:

    npm (12-26-2016)

  13. #8
    Zachafer's Avatar
    Join Date
    Dec 2011
    Posts
    1,219
    Userbars
    6
    Thanks
    762
    Thanked 1,445 Times in 673 Posts
    Downloads
    97
    Uploads
    0
    Mentioned
    508 Post(s)
    Time Online
    24 d 8 h 7 m
    Avg. Time Online
    10 m
    Rep Power
    18
    @hectorvazc ideally you should be storing all cookies that are set by Set-Cookie in the HTTP Response. Remember the goal is to remain undetected and a foundational piece of this is emulate a browser's HTTP requests exactly
    @Accelerator the neologin cookie value is what keeps you logged into Neo
    @Daviid the PHPSESSID is the PHP identifier of the $_SESSION array and other session variables stored on the Neo server for the current user's session

  14. The Following 2 Users Say Thank You to Zachafer For This Useful Post:

    Accelerator (12-28-2016),npm (12-28-2016)

  15. #9
    npm's Avatar
    Join Date
    Dec 2011
    Posts
    780
    Userbars
    14
    Thanks
    735
    Thanked 561 Times in 217 Posts
    Downloads
    84
    Uploads
    3
    Mentioned
    109 Post(s)
    Time Online
    83 d 20 h 16 m
    Avg. Time Online
    37 m
    Rep Power
    12
    Quote Originally Posted by Zachafer View Post
    @hectorvazc ideally you should be storing all cookies that are set by Set-Cookie in the HTTP Response. Remember the goal is to remain undetected and a foundational piece of this is emulate a browser's HTTP requests exactly
    Thanks, right now im even updating and saving my cookies as per every request so the cookies are exactly as the browser behavior.
    My problem was assuming I was getting all the cookies from the beginning.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •