How to track UserId using cookies?

Please support our C# advertiser: Intel Parallel Studio Home
Reply

Join Date: Aug 2006
Posts: 20
Reputation: happy8899 is an unknown quantity at this point 
Solved Threads: 0
happy8899 happy8899 is offline Offline
Newbie Poster

How to track UserId using cookies?

 
0
  #1
Jan 17th, 2008
I have been using The Beer House web example to develope a project and i wan to add photo gallery inside but i m stuck when i can't get the user login identification from the web login which uses the cookies as the user authentication. I want to personalize the photo gallery to each user having their own photo retrieve from database by comparing their user Id.
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 15
Reputation: _tim is an unknown quantity at this point 
Solved Threads: 0
_tim _tim is offline Offline
Newbie Poster

Re: How to track UserId using cookies?

 
0
  #2
Jan 17th, 2008
Sounds like a great idea!

Two thoughts - firstly, is it possible that your cookie is expiring before you can get the data?

Secondly,have you stepped through your code or put in a test variable so thgat you can see if the cookie is getting populated? That's at least one way to at least see that the info you need is in fact getting populated.

Try something likes this:

  1. HttpCookie _cookie = new HttpCookie("MyCookie");
  2.  
  3. _cookie.Value = _userId.Text; //Whatever captures your user's id for authentication - a textbox, whatever
  4.  
  5. string _test = _cookie.ToString(); //set a breakpoint here and make sure you have the value.

Hope that helps.
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 20
Reputation: happy8899 is an unknown quantity at this point 
Solved Threads: 0
happy8899 happy8899 is offline Offline
Newbie Poster

Re: How to track UserId using cookies?

 
0
  #3
Jan 23rd, 2008
Thanks for the clue but what i want to find id the _userId.Text. I can't get the UserId from the Beer house Web example cause i don't have any idea where to get it. Hope you can get the Beer house example and look into it how to get the UserId from the website
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C# Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC