Click here to Skip to main content
15,914,481 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionHow to best secure a betting information web site. Pin
Brady Kelly9-Mar-11 19:37
Brady Kelly9-Mar-11 19:37 
AnswerRe: How to best secure a betting information web site. Pin
Dalek Dave16-Mar-11 12:26
professionalDalek Dave16-Mar-11 12:26 
QuestionMasterpages Pin
msqar9-Mar-11 7:58
msqar9-Mar-11 7:58 
AnswerRe: Masterpages Pin
Not Active9-Mar-11 8:25
mentorNot Active9-Mar-11 8:25 
GeneralRe: Masterpages Pin
msqar9-Mar-11 8:30
msqar9-Mar-11 8:30 
GeneralRe: Masterpages Pin
Not Active9-Mar-11 8:55
mentorNot Active9-Mar-11 8:55 
GeneralRe: Masterpages Pin
msqar9-Mar-11 9:07
msqar9-Mar-11 9:07 
QuestionCreating cookies with HttpCookie vs. Response.Cookies Pin
goodideadave9-Mar-11 6:48
goodideadave9-Mar-11 6:48 
I have a web site on an internal web server on our enterprise network. When a user who is a member of the admin group on the web server visits the page, cookies are created on the main page and read just fine on the other pages. But if it's a user who is not in that group, no errors are thrown but the cookies don't seem to be written.

MSDN gives two techniques for writing cookies. This one does not throw an error, but neither does it create the cookie for all users:

HttpCookie c = new HttpCookie("userinfo");
c.Values["domainaccount"] = _CtaUser.DomainAccount;
c.Values["userid"] = _CtaUser.UserID.ToString();
c.Values["username"] = _CtaUser.UserName;
c.Values["rolename"] = _CtaUser.RoleName.ToLower();
c.Values["ctaactiveflag"] = (_CtaUser.CTAActiveFlag) ? "1" : "0";
c.Expires = DateTime.Now.AddDays(1d);
Response.Cookies.Add(c);


This technique works just fine for all users:
Response.Cookies["userinfo"]["domainaccount"] = _CtaUser.DomainAccount;
Response.Cookies["userinfo"]["userid"] = _CtaUser.UserID.ToString();
Response.Cookies["userinfo"]["username"] = _CtaUser.UserName;
Response.Cookies["userinfo"]["rolename"] = _CtaUser.RoleName.ToLower();
Response.Cookies["userinfo"]["ctaactiveflag"] = (_CtaUser.CTAActiveFlag) ? "1" : "0";
Response.Cookies["userinfo"].Expires = DateTime.Now.AddDays(1);


As near as I can tell, the browsers for all users are setup identically, and we have tested with IE7 and FF. Can anyone point out what I'm doing wrong? Thanks.
My other signature is witty and insightful.

QuestionGridview vertically Pin
prakulsol9-Mar-11 6:15
prakulsol9-Mar-11 6:15 
AnswerRe: Gridview vertically Pin
Ali Al Omairi(Abu AlHassan)9-Mar-11 12:01
professionalAli Al Omairi(Abu AlHassan)9-Mar-11 12:01 
AnswerRe: Gridview vertically Pin
thatraja9-Mar-11 15:03
professionalthatraja9-Mar-11 15:03 
AnswerRe: Gridview vertically Pin
Prasanta_Prince14-Apr-11 1:54
Prasanta_Prince14-Apr-11 1:54 
QuestionHow to use Process Monitor to determine which DLL is causing a BadImageFormatException. [modified] Pin
Brady Kelly8-Mar-11 19:41
Brady Kelly8-Mar-11 19:41 
QuestionAutorefresh in time interval Pin
prakulsol8-Mar-11 17:09
prakulsol8-Mar-11 17:09 
AnswerRe: Autorefresh in time interval Pin
Pravin Patil, Mumbai8-Mar-11 21:10
Pravin Patil, Mumbai8-Mar-11 21:10 
AnswerRe: Autorefresh in time interval Pin
goodideadave9-Mar-11 8:46
goodideadave9-Mar-11 8:46 
QuestionPage.Request.Form("ControlName") returns null Pin
Ali Al Omairi(Abu AlHassan)6-Mar-11 23:32
professionalAli Al Omairi(Abu AlHassan)6-Mar-11 23:32 
AnswerRe: Page.Request.Form("ControlName") returns null Pin
Anurag Gandhi7-Mar-11 0:08
professionalAnurag Gandhi7-Mar-11 0:08 
GeneralRe: Page.Request.Form("ControlName") returns null Pin
Sunasara Imdadhusen7-Mar-11 22:57
professionalSunasara Imdadhusen7-Mar-11 22:57 
AnswerRe: Page.Request.Form("ControlName") returns null Pin
J a a n s7-Mar-11 0:14
professionalJ a a n s7-Mar-11 0:14 
GeneralRe: Page.Request.Form("ControlName") returns null Pin
Sunasara Imdadhusen7-Mar-11 22:57
professionalSunasara Imdadhusen7-Mar-11 22:57 
GeneralRe: Page.Request.Form("ControlName") returns null Pin
Ali Al Omairi(Abu AlHassan)8-Mar-11 7:37
professionalAli Al Omairi(Abu AlHassan)8-Mar-11 7:37 
GeneralRe: Page.Request.Form("ControlName") returns null Pin
Pete O'Hanlon8-Mar-11 10:34
mvePete O'Hanlon8-Mar-11 10:34 
GeneralRe: Page.Request.Form("ControlName") returns null Pin
Ali Al Omairi(Abu AlHassan)9-Mar-11 11:20
professionalAli Al Omairi(Abu AlHassan)9-Mar-11 11:20 
GeneralRe: Page.Request.Form("ControlName") returns null Pin
Pete O'Hanlon10-Mar-11 8:02
mvePete O'Hanlon10-Mar-11 8:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.