Hi,
i have webviewer that is connected with a page that creates 3 cookies when login is correct.
Great, what i want is that when the screen starts (when the app starts) it reads cookies and reading cookies it says to the php pages if the user can login or not.
The problem is that when i login in the php and i generates cookies, then if i exit from the app and i re-entry the cookies seems to be not read by the extension… strange to say. I hope you understand to help me thanks
Assuming you have the Home Url set in the designer for the webviewer (?), this could be a timing issue.
Try starting a clock in Screen1.initialise (say 500ms interval), then in the clock timer event stop the clock, then set the label to the GetCookies block.
Hi Tim.
I really cannot solve this issue…
I reattach the block.
I explain what happened:
When you open the app you go to index.php page.
On this page the is a check: if cookie is empty it redirects to content.php page.
On content.php the user can click on sign.php and a new cookie will be saved.
Now if i exit the app, when i reopen it the cookie should be read and i don’t have to be redirected to content.php page… but this doesn’t happened.
Otherwise if i clear all cookies and i exit app more then one time, it works: i will be redirected to content.php page…
I attach block img and php file so you can replicate.
Thanks for your patience
hi taifun,
it’s the same with mit app inventor.
i can do the project with mit app inv.
can you help me ?
do you need the .aia project to better understand?
sorry but i strongly need a solution for this.
i appreciate your kindly help
each builder is different, therefore ask in the community of the builder you are using
alternatively create your project in App Inventor, check, if the issue still is there, and if yes, provide the relevant App Inventor blocks as screenshot
as you have seen, for @TIMAI2 the example works fine
Hi Juan,
i installed your block codes and added the call of cookie also on the init screen but the result is wrong.
When i try to exit from app and re-entry the loaded cookie is lost…
try by loading more times cookies and clear more times, by exiting from the app…
i added an exit app button… the cookie is not saved into the app… i have to reload by clicking on the button…
this is not what i want…
i want that the cookie will be read automatically when the app starts. If present on the mobile, when i exit from the app, it must be available also when i re-open the app…
as for chrome or other desktop browser.
The idea is to create a login page via webviewer that read cookies when the app start and if the login is ok then the cookie is saved and available for the future. Cookies-edited.aia (10.9 KB)
doesn’t work…
i open app… i click on get cookies button. I see that tthe cookie is saved.
then i click on exit app so when i reopen the app i should see the cookie saved… .but no: it says that cookie user is not set…