iPhone UIwebview移动Web应用程序的持久cookie [英] Persisting cookie for iPhone UIwebview mobile web app

查看:109
本文介绍了iPhone UIwebview移动Web应用程序的持久cookie的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用MVC4表单身份验证.我的移动网络应用程序在iPhone上以全屏UIwebview运行.我的移动网络应用有一个主屏幕图标.该应用程序需要启动外部链接.那些是在Safari中启动的,效果很好.但是,通过再次单击主屏幕图标返回到移动Web应用程序,似乎已使用户注销.理想情况下,我希望用户在Safari中查看外部链接后仍保持登录Web应用程序的状态. Cookie可能被删除了吗?我可以保留cookie吗?

I'm using MVC4 forms auth. My mobile web app runs in full screen UIwebview on iphone. I have a home screen icon for my mobile web app. The app needs to launch external links. Those launch in Safari, which works fine. However returning to the mobile web app by clicking again on the home screen icon, seems to have logged the user out. Ideally I want the user to remain logged into the web app after viewing the external links in Safari. Maybe the cookie got deleted? Can I persist the cookie?

推荐答案

FormsAuthentication.SetAuthCookie(username, createPersistentCookie: true);

这解决了注销问题

这篇关于iPhone UIwebview移动Web应用程序的持久cookie的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆