asp.net - Cookie not getting created when redirecting? -
i have following in controller:
public actionresult login(string email, string password) { /* stuff ... */ httpcookie customercookie = new httpcookie("customer"); customercookie.values.add("firstname", customer.firstname); customercookie.values.add("lastname", customer.lastname); customercookie.values.add("email", email); customercookie.secure = true; response.cookies.add(customercookie); return redirecttoaction("ordertype", "order"); }
but reason when cookie found after redirect. based on this question assuming method above work.
can see why cookie not being created here?
some troubleshooting steps take:
- remove redirect , return empty view , see if cookie there
- do not set secure true , see if that's issue
- force response flush see if there's action filter or post action execution that's preventing cookie being returned in response
- use fiddler @ actual http response cookie in case browser preventing cookies
Comments
Post a Comment