0
這是我的c#代碼.NET移動應用程序,爲什麼我的Cookie不能在Safari瀏覽器(Iphone)中讀取?
UserLocation uc = UserLocation.ReadCookie(0); if(uc!= null) { userLoc1.Text = uc.City +「,」+ uc.State; } else { userLoc1.Text =「選擇放映時間的位置」; }
<div class="showUser">
<a href="/Theatres" class="tabtheatres" id="select-location">
<div class="container">
<div class="icon"></div>
<div class="text">
<asp:Label ID="userLoc1" runat="server" clientIDMode="Static"></asp:Label>
</div>
</div>
</a>
</div>
正在執行的C#代碼,因爲它是把「選擇在文本放映時間」,但顯然UC ......它來自一個cookie用戶位置爲空,它不應該是,在調試中,它不是......所以cookie顯然不被讀取,但在Safari上。
我的研究表明,我可以將此代碼添加到web.config中aleviate這個問題:
<sessionState cookieless="true" />
,但將使用此web.config中影響其他應用程序?
請指教。 問候,
有兩個問題,那麼 –
也是如此,我對影響應用程序的其他部分感到緊張......這個代碼有沒有任何風險? –
我們有一個傳統的asp應用程序,在我工作的時候,當IE11出現時,它完全是borked,因爲它是如何通過useragent識別的。無論如何告訴iis強制cookie,一切都很順利。我不能爲你的申請發言,但我*不認爲*它會影響其他內容 – mituw16