Last post Jan 11, 2019 03:49 PM by mgebhard
Jan 11, 2019 08:00 AM|kengkit|LINK
Hi guys, my web application having an issue.
Cookies value will be lost when redirecting to a new page (dashboard.aspx)
This problem ONLY occurred when I log-in using apple phone (iOS). Working fine in android phone and desktop.
I have confirmed my safari is Cookies Enabled. Any idea?
If IsNothing(Request.Cookies("CustomerInCakes")) = False Then
me.lbl_result.Text = "Cookies is NOT existing"
If IsNothing(Request.Cookies("CustomerInCakes")) = True Then
Response.Write("Cookies is NOT existing")
Response.Write("Cookies is existing")
Dim colCookies As ArrayList = New ArrayList
Dim i As Integer = 0
Do While (i < Request.Cookies.Count)
i = (i + 1)
Me.GridView.DataSource = colCookies
<adapter controlType="System.Web.UI.HtmlControls.HtmlForm" adapterType="FormRewriterControlAdapter" />
<capability name="cookies" value="true" />
Jan 11, 2019 09:09 AM|PatriceSc|LINK
I've seen this asked quite few times in this forum and never remember to test about this. My understanding is that when sending both cookies and doing a redirect some browsers (ie Safari ?) are doing only the redirect. Most often the response is to redirect
on the client side instead.
Edit: old but for example: https://discussions.apple.com/thread/7770177
(you have a single redirect or in close succession, this is not cross domain, you may want just to try a basic test to make sure what happens).
Jan 11, 2019 09:45 AM|kengkit|LINK
Sorry i don't see any solution from your link. I have make sure my safari is enabled cookies. And yes it's NOT cross domain redirection.
Based on my testing.. my cookies is existing before redirecting to page B. Any idea?
Jan 11, 2019 10:21 AM|PatriceSc|LINK
It was just to point it seems a Safari behavior.
I would test maybe with Chrome or Edge on the same iOS version (wonder if this is Safari or some underlying behavior in the http stack). This is which version of Safari/iOS ?
Jan 11, 2019 11:03 AM|kengkit|LINK
ScriptManager.RegisterStartupScript(Me.Page, Page.GetType, "text", "Redirect()", True)
my iOS version is 12.1.2
I have tried with (Firefox version 14.0) but still failed.
Jan 11, 2019 11:37 AM|PatriceSc|LINK
You are 100% sure you removed the server side redirection ?
Else I would try maybe one page that set cookies and on which I click manually to go another page. If cookies are not sent yet, it would really point at a general cookie issue (try maybe to clear the browser cache to see what happens) rather than just this
"set cookie and redirect in the same response" issue.
Or maybe you mistakenly use http with "secure cookies" (they are sent back only if using https).
Jan 11, 2019 03:49 PM|mgebhard|LINK
There is no indication that you have set a cookie in the first place. Can you share the code that sets the cookie and explain the design? Try setting a break point on the code that creates the cookie and verify it works.