我使用 Cordova 开发应用程序,并利用
cordova-plugin-inappbrowser
打开本地 index.html
文件,该文件又在应用程序中显示网站。
window.location='https://example.com/index.cfm?app_token='+token+'&model='+device.model+'&platform='+device.platform+'&manufacturer='+device.manufacturer+'&version='+device.version;
用户必须登录 example.com。为了在 example.com 上启用“保存登录”功能,我使用 Lucee 以编程方式设置 cookie。该 cookie 用于安全地存储用户的登录凭据,因此当他们再次访问该网站时,他们会自动登录,而无需重复输入凭据。
<cfcookie samesite="strict"
name="RememberMe"
value="#strRememberMe#"
expires="never"
httponly="true" secure="true"
/>
用户抱怨他们必须再次登录,所以我认为 cookie 没有设置。所以我用这个方法4年,创建了40个这样的应用程序。一开始有些用户抱怨必须重新登录。但在我最新的应用程序上,很多用户必须每天登录。
我用:
到目前为止我尝试过的:
要求:
webview 使用 https 提供,因此您的 cookie 无法设置为
httponly="true"