Felix

unread,
Aug 25, 2017, 4:43:03 PM8/25/17
to MIT App Inventor Forum
Hi Team :)



i use ai2 for some time now and am just in coding a new app ...


I try to open thingspeak.com/login in my app and to login to see special data from my account.

- when u open login site you will get a cookie, not that problem,
- but when you send a special token now (given in the html response), the cookie (saved by web component) and the login data to /users/sign_in
the server sets a new cookie and redirects you to /mwa_linking, but web component doesnt take the new cookie and sends the old one,.... no login


i know that the token and the login data are given in the correct way, because at the beginning i got an error and after changing the app i get an 200
response code from the thingspeak server and am redirected to the mwa_linking page.


so how can i tell the web component to take the new cookie from the redirected site?
any extensions?


thanks and greets from germany,
Felix

Felix

unread,
Aug 25, 2017, 4:57:45 PM8/25/17
to MIT App Inventor Forum
I Just found this:

http://thunkableblocks.blogspot.de/2017/06/webviewcookietools-extension.html

maybe i can use this to get the cookie from the sign_in site?

greetz

Abraham Getzler

unread,
Aug 25, 2017, 5:51:00 PM8/25/17
to MIT App Inventor Forum
- when u open login site you will get a cookie, not that problem,
- but when you send a special token now (given in the html response), the cookie (saved by web component) and the login data to /users/sign_in
the server sets a new cookie and redirects you to /mwa_linking, but web component doesnt take the new cookie and sends the old one,.... no login

Just guessing here.

Maybe you need an extra Web component, to split the handling of the first phase from the second phase of the login?

ABG
 

Felix

unread,
Aug 27, 2017, 7:00:36 AM8/27/17
to mitappinv...@googlegroups.com
hi abraham,


at the beginning i tried so, web1 and web2, but the web2 doenst have the same cookies.

atm i do it like this:



today i will try some other ideas...


greetz




maybe this......?

http://thunkableblocks.blogspot.de/2017/06/webviewcookietools-extension.html

Taifun

unread,
Aug 27, 2017, 10:17:21 AM8/27/17
to MIT App Inventor Forum
I try to open thingspeak.com/login in my app and to login to see special data from my account.
you might want to try this solution? However I don't know, if it will help in your case...
Taifun

Felix

unread,
Aug 28, 2017, 9:50:51 AM8/28/17
to mitappinv...@googlegroups.com

Hi,

 

 

i had success... :)

 

Maybe it is possible to do it as i wanted it to do, but i found another solution.

 




1) use the webviewer component to open site and to login

2) use WebViewCookieTools - Extension to read the webviewer given cookie

3) hand over the cookie to the web component and open site

 

now i can open the sites i need and pick out the data i need by responsecontent

 

it works in my case and so my problem got solved so far :P

 

 

thanks for any idea,

greetz hilgi

Reply all
Reply to author
Forward
0 new messages