以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- [求助]苹果手机没问题,安卓手机获取不到Cookies (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=129638) |
-- 作者:浙江仔 -- 发布时间:2019/1/3 9:53:00 -- [求助]苹果手机没问题,安卓手机获取不到Cookies 苹果手机没问题,安卓手机获取不到e.Cookies("paperid"),真奇怪 Dim e As RequestEventArgs = Args(0) \'身份验证,公众号 Dim Openid As String \'微信用户Openid \'Dim sb As New StringBuilder Dim wb As New weui Dim dt As DataTable Dim entid As String Dim pdcode As String Dim entname As String Dim paperid As String=e.Cookies("paperid") \'Dim sb As New StringBuilder If e.GetValues.ContainsKey("paperid") Then paperid=e.GetValues("paperid") wb.Appendcookie("paperid",paperid) End If If e.host="127.0.0.1" Then Openid ="otmQFs6MaQBpfCrkihqi_XMw4V4s" Else If e.Cookies.ContainsKey("pxopenid") Then \'从cookie中获取微信用户id Openid = e.Cookies("pxopenid") Else Dim ul2 As String If redirectUl="true" Then ul2 ="http://eso.deqsafety.gov.cn/get-weixin-code.html?appid={0}&scope=snsapi_base&state="+ e.path +"&redirect_uri="+ UrlEncode("http://" & e.host & "/MpRedirect.htm/" ) Else ul2 ="https://open.weixin.qq.com/connect/oauth2/authorize?appid={0}&redirect_uri="+ UrlEncode("http://" & e.host & "/MpRedirect.htm/" )+ "&response_type=code&scope=snsapi_base&state="+ e.path +"#wechat_redirect" End If ul2=CExp(ul2,mpCorpID) wb.InsertHTML("<meta http-equiv=\'Refresh\' c>") \'跳转到授权链接 e.WriteString(wb.Build) e.Handled = True Return "" End If End If If openid ="" Then With wb.AddMsgPage("","msgpage","错误","无效登录") .icon = "Warn" \'改变图标 End With e.WriteString(wb.Build) e.Handled = True Return "" Else wb.Appendcookie("pxopenid",openid ) \'paperid =e.Cookies("paperid") End If If paperid="" Then With wb.AddMsgPage("","msgpage","错误","参数错误") .icon = "Warn" \'改变图标 End With e.WriteString(wb.Build) e.Handled = True Return "" End If |
-- 作者:有点甜 -- 发布时间:2019/1/3 10:00:00 --
设置cookie的时候,弹出paperid的值看一下,看是否执行了设置cookie的代码了。
|