c# - Cookie is not working in MAC -Safari & IOS Mobile- Safari -
i creating model,serializing & assigning cookie , passing next page. able cookie values in next page in browser except
- mac -yoshemite - safari
ios - iphone 6 mobile- safari
do need update below code work in safari.
string cookiename= "dsresponse"; string json = new javascriptserializer().serialize(model); if (httpcontext.current.request.cookies[cookiename] != null) { httpcontext.current.response.cookies[cookiename].expires = datetime.now.adddays(-1); } httpcontext.current.response.setcookie(new httpcookie(cookiename) { value = json, httponly = false, expires = datetime.now.addseconds(convert.toint32(configurationmanager.appsettings["cookiesecond"])) });
1st: overwriting cookie - not expiring code. response object sent once - "new" cookie. if cookie exists - change value and/or content. check assumption on appsettings["cookiesecond"]
also try this:
if request.servervariables("http_user_agent").indexof("safari", stringcomparison.currentcultureignorecase) <> -1 me.page.clienttarget = "uplevel"
it may browser caps not matching...
Comments
Post a Comment