HTTP Request instance

Post your questions and help other users.

Moderator: Martin

Post Reply
Snify
Posts: 27
Joined: 04 May 2017 10:09

HTTP Request instance

Post by Snify » 02 Jan 2020 00:17

I find this rather a bug than a feature. Could you please make the HTTP request action unique for each running flow instance?

This is about the cookies since these are shared across all flows for the same domain. The clear cookies action could still stay and can be useful for avoiding flow restarts.

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: HTTP Request instance

Post by Desmanto » 02 Jan 2020 10:37

I would argue it is featured. I have several flows to login to different routers, HTTP request need to be done in succession. So first I have to post the login username password, retrieve token, parse the token and then use it in the next request to query other information. Some require extra 2-3 requests to reach the information/command I need. The whole requests should be in the same session, otherwise it will be rejected at the second request, for having different cookies/session id.

This works the same with the common popular browser, where all tabs share the same session. While the private/incognito gets another session. In most browser, you have maximum these 2 sessions. Some addon/plugin can extend this to multiple sessions.

Automagic currently only have 1 session for all HTTP request. You need separate sessions, so we need to request additional session feature. So this thread should be moved to feature requests. I don't know how many you need, but I think 5 separate sessions should be enough for most users. So this request will be : action HTTP request and Download URL, additional option to choose the session number. All previously created actions will default to session 1.

At your similar request for clearing cookies : viewtopic.php?f=5&t=8135
The requested clear cookies action also should be able to choose which sessions to clear. The choice is in multiple checkbox, so I can clear cookies for action 1, 3, 5; or cookies 2, 3, 4, or only 5. Clearing cookies at certain session before using HTTP request on that session, is very similar to incognito browsing (I don't know about the history or caching in Automagic though).
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

Snify
Posts: 27
Joined: 04 May 2017 10:09

Re: HTTP Request instance

Post by Snify » 02 Jan 2020 18:46

I recently stumpled upon this. I thought they were unique, so I guess it is a feature request :)
But why not make each flow execution unique in terms of HTTP requests? Cookies can still stay within each flow privately or can be restored if needed.

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: HTTP Request instance

Post by Desmanto » 02 Jan 2020 19:15

Flow limited cookies might be a good choice too. But some users implement their flow in terms of "task flow". Where they might use 1 http request in the starter flow, and then call another "task flow" where they store their main giant flow to do the routine task. Once the caller flow leaves the flow, the cookies are lost. if it is going to be this way, then the caller flow should pass the cookies to the child flow and maybe return back the cookies if Return Variables are ticked. Maybe then we need another action to save the cookies (and restore as you hint).

I don't know which are more practical and easier to implement. Using separate session choice will allow incognito session as long as we choose different session. While using flow limited cookies method will always create new incognito everytime it execute. Of course with the action save/restore/clear cookies, it will be much more flexible. We can create separate session in a single flow execution, by clearing the cookies before getting into another http request in the same flow.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

Post Reply