vb.net - Firefox does not accept ASP.NET authentication cookies -
i'm having issue firefox browser when deploy our application qa environment. have asp.net 4 application form authentication. in our application, have 2 cookies: 1 authentication ticket, other information. issue is: everytime login system using firefox, i'm bounced login page. when use fiddle investigate issue, found out reason firefox doesn't "accept" our cookies: 1st request login page, our server returns cookies fine in headers:
set-cookie: .aspxauth_imp=...; expires=thu, 07-jun-2012 06:37:24 gmt; path=/ set-cookie: .aspxauth=...; expires=wed, 06-jun-2012 09:57:24 gmt; path=/
however, in next response, our cookies not present in request header. issue not happen in other browsers (ie, chrome, etc). in other browsers, cookies accepted , passed along in next requests.
when view cookies stored in firefox, can see website, has asp.net_sessionid cookie. there's no trace of other 2 cookies. 1 more interesting point issue happens in qa environment ( has lan ip 10.16.x.x. tried use machine name the issue persists). when debug in visual studio using localhost, works fine. code sending cookie client:
' asp.net authentication cookie ' dim cookieexpiration datetime = datetime.now.addminutes(constants.websettingsconst.timeout) dim authenticationticket = new formsauthenticationticket(2, currentcontext.usercontextid(), datetime.now, cookieexpiration, true, string.empty, formsauthentication.formscookiepath) dim encryptedticket string = formsauthentication.encrypt(authenticationticket) dim authcookie = new httpcookie(formsauthentication.formscookiename, encryptedticket) authcookie.expires = authenticationticket.expiration authcookie.path = formsauthentication.formscookiepath 'httpcontext.current.response.cookies.remove(formsauthentication.formscookiename)' httpcontext.current.response.cookies.add(authcookie)
it sounds obvious, have checked cookie settings in firefox. if go privacy , pick use custom history can specify not accept cookies third parties or specific sites.
i'm doing same , have no problems.
dim authticket new formsauthenticationticket(1, useridentity, date.now, _ date.now.addminutes(15), false, userdata) dim encticket string = formsauthentication.encrypt(authticket) dim facookie new httpcookie(formsauthentication.formscookiename, encticket) response.cookies.add(facookie)
Comments
Post a Comment