android webview can't get session when using target="_blank" with link.
创新互联建站是一家专业提供凉山州企业网站建设,专注与成都网站制作、网站设计、H5场景定制、小程序制作等业务。10年已为凉山州众多企业、政府机构等服务。创新互联专业网络公司优惠进行中。### Version 3.5.1 (maybe 3.5.0 included,not sure)
* vert.x core:
* vert.x web:
### Context
I used android webview to call a vertx url,when I switched from one page to another, the vertx server would always generate a new session id, so I lost session data set by previous page.
But,when I use iphone webview or PC Chrome to call the same vertx server, the session can be remembered correctly. so the error is only subject to android webview
### Do you have a reproducer?
we can reproducer the error following the steps below.
### Steps to reproduce
1. write a smiple verticle
public class Test1Verticle extends AbstractVerticle { Router router1 ; @Override public void start() throws Exception { router1 = Router.router(vertx); router1.route().handler(CookieHandler.create()); router1.route().handler(SessionHandler.create(LocalSessionStore.create(vertx))); router1.route("/h6/*").handler(StaticHandler.create("web/h6")); router1.route("/hit").handler(this::hit); vertx.createHttpServer().requestHandler(router1::accept).listen(8080) ; } private void hit(RoutingContext routingContext) { Session session = routingContext.session(); Integer cnt = session.get("hitcount"); cnt = (cnt == null ? 0 : cnt) + 1; session.put("hitcount", cnt); routingContext.response().putHeader("content-type", "application/json;charset=UTF-8") .end(new JsonObject().put("data", "cnt="+cnt) ); } }
2. place 2 html files in the web/h6 file folder,named test3.html and test4.html respectively. test3.html source code:
test3.html
Copyright © 2009-2022 www.kswsj.com 成都快上网科技有限公司 版权所有 蜀ICP备19037934号