User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 391,899 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,558 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 965 | Replies: 3
Reply
Join Date: Jul 2005
Location: Dallas, TX
Posts: 481
Reputation: campkev is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 19
campkev campkev is offline Offline
Posting Pro in Training

Cookies are driving me nuts

  #1  
Jan 25th, 2006
Been banging my head against the wall for the last several hours. What the &^*% am I doing wrong.

Code to set the cookie
Response.Cookies["mydomain-LoginName"].Value = ((Login)sender).UserName;
                        Response.Cookies["mydomain-LoginName"].Expires = DateTime.Now.AddDays(30);
code to read the information back in
strLoginName = Request.Cookies["mydomain-LoginName"].Value;
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jan 2006
Location: Its the internet... i am everywhere lol
Posts: 274
Reputation: f1 fan is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 10
f1 fan f1 fan is offline Offline
Posting Whiz in Training

Re: Cookies are driving me nuts

  #2  
Jan 25th, 2006
first try
strLoginName = Server.HTMLEncode(Request.Cookies["mydomain-LoginName"].Value);

Are you not getting anything? Does your browser not accept cookies? Or only from certain paths? If it doesnt you wont get an error. Test with Request.QueryString["AcceptsCookies"] to find out.
Reply With Quote  
Join Date: Jul 2005
Location: Dallas, TX
Posts: 481
Reputation: campkev is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 19
campkev campkev is offline Offline
Posting Pro in Training

Re: Cookies are driving me nuts

  #3  
Jan 25th, 2006
I finally figured it out. It was the new Login object in asp.net 2.0. It never completes the response, just redirects to another page. Response never ends so cookie never got written.(or something like that) So I just passed it to the page I was redirecting to and had that page write it.
Reply With Quote  
Join Date: Jan 2006
Location: Its the internet... i am everywhere lol
Posts: 274
Reputation: f1 fan is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 10
f1 fan f1 fan is offline Offline
Posting Whiz in Training

Re: Cookies are driving me nuts

  #4  
Jan 25th, 2006
oh, it uses its own cookies. Set the expiration etc in the web config. Both sliding and absolute. They have it all built in. If you need the config stuff let me know
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb ASP.NET Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the ASP.NET Forum

All times are GMT -4. The time now is 7:29 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC