Cookie reading with MBS Plugin?

I just quickly tested on cnn.com.

This shows a whole list of cookies in TitleChanged :

HTMLViewer1.ExecuteJavaScript("document.title=document.cookie;")

ug=566c59e806dc4a0a3c852e0f23024479; ugs=1; __gads=ID=7c10df1f47df7795:T=1449941488:S=ALNI_MZkwjJAy6uLOv8k1X4tWvhsCUvOSQ; __vrf=1449941787264KDijOmFihc2k4nJXWQjMtKlXNkkJ5NQv; _dy_c_exps=; _dy_csc_ses=t; _dy_geo=US.NA.US_FL.US_FL_Miami; _dy_ses_load_seq=63191%3A1449941784262; _dy_toffset=-310; _dycst=dk.m.ob.ss.fst.frv1.frs.; _dyfs=true; _dyid=-6737384998146647575; _dyus_8766314=0%7C0%7C0%7C0%7C0%7C0.0.1449941791474.1449941791474.0.0%7C345%7C50%7C11%7C115%7C1%7C0%7C0%7C0%7C0%7C0%7C0%7C1%7C0%7C0%7C0%7C0%7C0%7C1%7C0%7C0%7C0%7C0%7C0; bknx_fa=1449941787256; bknx_ss=1449941787256; optimizelyBuckets=%7B%7D; optimizelyEndUserId=oeu1449941783960r0.0217390195466578; optimizelySegments=%7B%22170962340%22%3A%22false%22%2C%22171657961%22%3A%22safari%22%2C%22172148679%22%3A%22none%22%2C%22172265329%22%3A%22direct%22%7D; s_cc=true; s_fid=4768F7DB14338064-02645306A93504C5; s_sq=%5B%5BB%5D%5D; s_vi=[CS]v1|2B362CF7051D7FA6-6000190F80005605[CE]

I also tried on Google.com and see a whole list as well.

Maybe the site you try to get cookies from uses just one ?

[quote=235350:@Michel Bujardet]I just quickly tested on cnn.com.

This shows a whole list of cookies in TitleChanged :

HTMLViewer1.ExecuteJavaScript("document.title=document.cookie;")

ug=566c59e806dc4a0a3c852e0f23024479; ugs=1; __gads=ID=7c10df1f47df7795:T=1449941488:S=ALNI_MZkwjJAy6uLOv8k1X4tWvhsCUvOSQ; __vrf=1449941787264KDijOmFihc2k4nJXWQjMtKlXNkkJ5NQv; _dy_c_exps=; _dy_csc_ses=t; _dy_geo=US.NA.US_FL.US_FL_Miami; _dy_ses_load_seq=63191%3A1449941784262; _dy_toffset=-310; _dycst=dk.m.ob.ss.fst.frv1.frs.; _dyfs=true; _dyid=-6737384998146647575; _dyus_8766314=0%7C0%7C0%7C0%7C0%7C0.0.1449941791474.1449941791474.0.0%7C345%7C50%7C11%7C115%7C1%7C0%7C0%7C0%7C0%7C0%7C0%7C1%7C0%7C0%7C0%7C0%7C0%7C1%7C0%7C0%7C0%7C0%7C0; bknx_fa=1449941787256; bknx_ss=1449941787256; optimizelyBuckets=%7B%7D; optimizelyEndUserId=oeu1449941783960r0.0217390195466578; optimizelySegments=%7B%22170962340%22%3A%22false%22%2C%22171657961%22%3A%22safari%22%2C%22172148679%22%3A%22none%22%2C%22172265329%22%3A%22direct%22%7D; s_cc=true; s_fid=4768F7DB14338064-02645306A93504C5; s_sq=%5B%5BB%5D%5D; s_vi=[CS]v1|2B362CF7051D7FA6-6000190F80005605[CE]

I also tried on Google.com and see a whole list as well.

Maybe the site you try to get cookies from uses just one ?[/quote]

[quote=235350:@Michel Bujardet]I just quickly tested on cnn.com.

This shows a whole list of cookies in TitleChanged :

HTMLViewer1.ExecuteJavaScript("document.title=document.cookie;")

ug=566c59e806dc4a0a3c852e0f23024479; ugs=1; __gads=ID=7c10df1f47df7795:T=1449941488:S=ALNI_MZkwjJAy6uLOv8k1X4tWvhsCUvOSQ; __vrf=1449941787264KDijOmFihc2k4nJXWQjMtKlXNkkJ5NQv; _dy_c_exps=; _dy_csc_ses=t; _dy_geo=US.NA.US_FL.US_FL_Miami; _dy_ses_load_seq=63191%3A1449941784262; _dy_toffset=-310; _dycst=dk.m.ob.ss.fst.frv1.frs.; _dyfs=true; _dyid=-6737384998146647575; _dyus_8766314=0%7C0%7C0%7C0%7C0%7C0.0.1449941791474.1449941791474.0.0%7C345%7C50%7C11%7C115%7C1%7C0%7C0%7C0%7C0%7C0%7C0%7C1%7C0%7C0%7C0%7C0%7C0%7C1%7C0%7C0%7C0%7C0%7C0; bknx_fa=1449941787256; bknx_ss=1449941787256; optimizelyBuckets=%7B%7D; optimizelyEndUserId=oeu1449941783960r0.0217390195466578; optimizelySegments=%7B%22170962340%22%3A%22false%22%2C%22171657961%22%3A%22safari%22%2C%22172148679%22%3A%22none%22%2C%22172265329%22%3A%22direct%22%7D; s_cc=true; s_fid=4768F7DB14338064-02645306A93504C5; s_sq=%5B%5BB%5D%5D; s_vi=[CS]v1|2B362CF7051D7FA6-6000190F80005605[CE]

I also tried on Google.com and see a whole list as well.

Maybe the site you try to get cookies from uses just one ?[/quote]

[quote=235350:@Michel Bujardet]I just quickly tested on cnn.com.

This shows a whole list of cookies in TitleChanged :

HTMLViewer1.ExecuteJavaScript("document.title=document.cookie;")

ug=566c59e806dc4a0a3c852e0f23024479; ugs=1; __gads=ID=7c10df1f47df7795:T=1449941488:S=ALNI_MZkwjJAy6uLOv8k1X4tWvhsCUvOSQ; __vrf=1449941787264KDijOmFihc2k4nJXWQjMtKlXNkkJ5NQv; _dy_c_exps=; _dy_csc_ses=t; _dy_geo=US.NA.US_FL.US_FL_Miami; _dy_ses_load_seq=63191%3A1449941784262; _dy_toffset=-310; _dycst=dk.m.ob.ss.fst.frv1.frs.; _dyfs=true; _dyid=-6737384998146647575; _dyus_8766314=0%7C0%7C0%7C0%7C0%7C0.0.1449941791474.1449941791474.0.0%7C345%7C50%7C11%7C115%7C1%7C0%7C0%7C0%7C0%7C0%7C0%7C1%7C0%7C0%7C0%7C0%7C0%7C1%7C0%7C0%7C0%7C0%7C0; bknx_fa=1449941787256; bknx_ss=1449941787256; optimizelyBuckets=%7B%7D; optimizelyEndUserId=oeu1449941783960r0.0217390195466578; optimizelySegments=%7B%22170962340%22%3A%22false%22%2C%22171657961%22%3A%22safari%22%2C%22172148679%22%3A%22none%22%2C%22172265329%22%3A%22direct%22%7D; s_cc=true; s_fid=4768F7DB14338064-02645306A93504C5; s_sq=%5B%5BB%5D%5D; s_vi=[CS]v1|2B362CF7051D7FA6-6000190F80005605[CE]

I also tried on Google.com and see a whole list as well.

Maybe the site you try to get cookies from uses just one ?[/quote]

[quote=235350:@Michel Bujardet]I just quickly tested on cnn.com.

This shows a whole list of cookies in TitleChanged :

HTMLViewer1.ExecuteJavaScript("document.title=document.cookie;")

ug=566c59e806dc4a0a3c852e0f23024479; ugs=1; __gads=ID=7c10df1f47df7795:T=1449941488:S=ALNI_MZkwjJAy6uLOv8k1X4tWvhsCUvOSQ; __vrf=1449941787264KDijOmFihc2k4nJXWQjMtKlXNkkJ5NQv; _dy_c_exps=; _dy_csc_ses=t; _dy_geo=US.NA.US_FL.US_FL_Miami; _dy_ses_load_seq=63191%3A1449941784262; _dy_toffset=-310; _dycst=dk.m.ob.ss.fst.frv1.frs.; _dyfs=true; _dyid=-6737384998146647575; _dyus_8766314=0%7C0%7C0%7C0%7C0%7C0.0.1449941791474.1449941791474.0.0%7C345%7C50%7C11%7C115%7C1%7C0%7C0%7C0%7C0%7C0%7C0%7C1%7C0%7C0%7C0%7C0%7C0%7C1%7C0%7C0%7C0%7C0%7C0; bknx_fa=1449941787256; bknx_ss=1449941787256; optimizelyBuckets=%7B%7D; optimizelyEndUserId=oeu1449941783960r0.0217390195466578; optimizelySegments=%7B%22170962340%22%3A%22false%22%2C%22171657961%22%3A%22safari%22%2C%22172148679%22%3A%22none%22%2C%22172265329%22%3A%22direct%22%7D; s_cc=true; s_fid=4768F7DB14338064-02645306A93504C5; s_sq=%5B%5BB%5D%5D; s_vi=[CS]v1|2B362CF7051D7FA6-6000190F80005605[CE]

I also tried on Google.com and see a whole list as well.

Maybe the site you try to get cookies from uses just one ?[/quote]

[quote=235350:@Michel Bujardet]I just quickly tested on cnn.com.

This shows a whole list of cookies in TitleChanged :

HTMLViewer1.ExecuteJavaScript("document.title=document.cookie;")

ug=566c59e806dc4a0a3c852e0f23024479; ugs=1; __gads=ID=7c10df1f47df7795:T=1449941488:S=ALNI_MZkwjJAy6uLOv8k1X4tWvhsCUvOSQ; __vrf=1449941787264KDijOmFihc2k4nJXWQjMtKlXNkkJ5NQv; _dy_c_exps=; _dy_csc_ses=t; _dy_geo=US.NA.US_FL.US_FL_Miami; _dy_ses_load_seq=63191%3A1449941784262; _dy_toffset=-310; _dycst=dk.m.ob.ss.fst.frv1.frs.; _dyfs=true; _dyid=-6737384998146647575; _dyus_8766314=0%7C0%7C0%7C0%7C0%7C0.0.1449941791474.1449941791474.0.0%7C345%7C50%7C11%7C115%7C1%7C0%7C0%7C0%7C0%7C0%7C0%7C1%7C0%7C0%7C0%7C0%7C0%7C1%7C0%7C0%7C0%7C0%7C0; bknx_fa=1449941787256; bknx_ss=1449941787256; optimizelyBuckets=%7B%7D; optimizelyEndUserId=oeu1449941783960r0.0217390195466578; optimizelySegments=%7B%22170962340%22%3A%22false%22%2C%22171657961%22%3A%22safari%22%2C%22172148679%22%3A%22none%22%2C%22172265329%22%3A%22direct%22%7D; s_cc=true; s_fid=4768F7DB14338064-02645306A93504C5; s_sq=%5B%5BB%5D%5D; s_vi=[CS]v1|2B362CF7051D7FA6-6000190F80005605[CE]

I also tried on Google.com and see a whole list as well.

Maybe the site you try to get cookies from uses just one ?[/quote]
Thanks Michel. I ll gonna try again.

And No, the site doesnt have one cookie. When i use the MBSCOOKIE plugin for mac i can retrieve all cookies from a specified url.

In fact, thinking if the site would have only one cookie. It should retrieve the cookie when i do the js. But i get nothibg

[quote=235353:@Gerardo García]Thanks Michel. I ll gonna try again.

And No, the site doesnt have one cookie. When i use the MBSCOOKIE plugin for mac i can retrieve all cookies from a specified url.

In fact, thinking if the site would have only one cookie. It should retrieve the cookie when i do the js. But i get nothibg[/quote]

Use the TitleChanged exactly as I did. There should be no problem.

Hi Michel, Thanks I made a separate project in order to test this, and In fact It work using your method, or EvaluateJavascriptMBS from Christian Plugins.

I tested with many pages and I can’t get cookies, but unfortunately the Website that I want to get the cookies, don’t show nothing.

I dunno if its possible to get the cookies from a certain URL, as I do with CookieMBS plugin?.

Now, I’m testing another solution:
Cuz I’m using IERunJavaScriptMBS to Run Javascripts on windows platform, The Render must be “Native”
I planning this:
When I’m running the JS i’ll set the Render mode in Native.
After this when I’m running the Getcookie module, set the Render mode in Webkit, in order to use ChromiumMBSBrowser to get all the cookies.

Once get both things, set it again the renderer to = Native.

Really?
Switching renderer mode?

[quote=235672:@Christian Schmitz]Really?
Switching renderer mode?[/quote]
Yes you are right, I tested and nothing happens.

I planned to to this:
HTMLViewer1.Renderer = 0

0 to Native
1 to Webkit.

What Am i doing wrong? Is this possible to switch rendering mode??

maybe only in constructor, so make two controls or maybe two windows.

I’m reading about document.cookie and it Say that It shows the cookies for the active site.

Maybe When I do this, I don’t get nothing, cuz the Cookie is on the previous page.

Its a login page, with User and Password, when I put successfully the id and pass, it Redirects to another page, so I use CancelLoad and a IF instruction to analyze the URL, to preserve that credentials to enter to the website desired.

I dunno if is It possible to get cookies in javascript of that previous page.

Regards

I ve read that its not possible to get cookies from different domain, cuz It would be a security issue. I tried to catch the cookie after login. And yes I got the first Cookie in CancelLoad event.

But my question is Where did you get this cookies, or how It works your plugin Chris?
in order to see if it would be possible to do in Javascript:

NSHTTPCookieStorageMBS.sharedHTTPCookieStorage.cookiesForURL

Cuz using this method in Mac I can get the other 4 cookies with its names and values.

Regards

I just checked the javaScript I posted above with GMail which is https and I get all the cookies fine. So it does snot seem to be a security issue.

It would help greatly if instead of asking questions in the dark, we could experiment with that site you talk about. URL ?

I tried with the site that im interested but i get no results.

Fortunately i applied christian’s solution.
I created two htmlviewers.
On both i do the login and enter the webpage.

In First viewer i set it the render to webkit. In order to use ChromeMbsCookies to catch all cookies.

In Second viewer I set Renderer mode to Native, in order to use IEMBSJavascript to execute javascript to get all the elements of the webpage that i want.(download links and filenames)

So, then i created an array with all links and used the cookie generated in order to pass it to a requestheader of a httpsecuresocket and finally download each link stored in the array