c# - .ASPXAUTH Cookie Not Found in Request.Cookies -


i creating web application hosted under web site forms authentication enabled. have role in authentication database "admins". here controller code:

[requirehttps] [authorize(roles = "admins")] public actionresult index() {   return this.view(); } 

when go index page, if i'm not authenticated, redirects me login page enter credentials. login page redirects index page of new app, controller doesn't recognize user authenticated.

i have taken authorize attribute off , looked @ request went out in chrome developer console , confirmed cookie indeed being sent. if leave authorize attribute is, , go index page, cookie collection on request in controller empty. headers collection contains header entitled "cookie", , value of header contains .aspxauth cookie.

the login page calls logs in code:

formsauthentication.setauthcookie(username, remember, "/"); 

this behavior reproducible in major browsers.

what can cause cookies collection of request populated?
need make application realize user authenticated?

edit:
still don't have working, i'm pretty sure it's aspxauth cookie being filtered.

i'm sure there multiple causes of problem. in case, problem version of mvc using write cookie different version decrypting it. changed sites running mvc 4, , cookie created 1 site consumable other site.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -