Ad
PHP And WebView - Cookie Doesn't Are The Same
I'm using a WebView to show a web application. All works, except one thing:
My login:
setcookie("USER_ID", $my_id, time() + 86400);
My logout:
setcookie("USER_ID", 0, time()-3600);
header('Location: ./index.php');
after that, i see the login page. And all is normal. The print_r of $_COOKIE array is:
Array
(
[PHPSESSID] => e44ceefl92jvesh0kddmdicmv1
)
there isn't any USER_ID. and is all correct.
But if i close the Android Webview and reopen this app, magically I am logged in! And if I print the cookie Array, is:
Array
(
[USER_ID] => 1 // WTF?!?
[PHPSESSID] => e44ceefl92jvesh0kddmdicmv1
)
it seems like the android webview send to the server an older cookie array.
Please Help!
--------------------edit----------------
also if i print
cookieManager.getCookie("MyUrl");
there is the USER_ID cookie that i've deleted with logout
Ad
Answer
I tried to do this onPageFinished
CookieManager.getInstance().cookieManager.flush();
it seems to work, but i'm not sure
Ad
source: stackoverflow.com
Related Questions
- → "failed to open stream" error when executing "migrate:make"
- → October CMS Plugin Routes.php not registering
- → OctoberCMS Migrate Table
- → OctoberCMS Rain User plugin not working or redirecting
- → October CMS Custom Mail Layout
- → October CMS - How to correctly route
- → October CMS create a multi select Form field
- → October CMS - Conditionally Load a Different Page
- → How to disable assets combining on development in OctoberCMS
- → October CMS - Radio Button Ajax Click Twice in a Row Causes Content to disappear
- → OctoberCms component: How to display all ID(items) instead of sorting only one ID?
- → In OctoberCMS how do you find the hint path?
- → How to register middlewares in OctoberCMS plugin?
Ad