943,712 Members | Top Members by Rank

Ad:
  • C# Discussion Thread
  • Unsolved
  • Views: 3220
  • C# RSS
Jan 17th, 2008
0

How to track UserId using cookies?

Expand Post »
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.
Similar Threads
  • spydoctor? in Viruses, Spyware and other Nasties
Reputation Points: 10
Solved Threads: 0
Newbie Poster
happy8899 is offline Offline
24 posts
since Aug 2006
Jan 17th, 2008
0

Re: How to track UserId using cookies?

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:

C# Syntax (Toggle Plain Text)
  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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
_tim is offline Offline
15 posts
since Jan 2008
Jan 23rd, 2008
0

Re: How to track UserId using cookies?

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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
happy8899 is offline Offline
24 posts
since Aug 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C# Forum Timeline: question in C#
Next Thread in C# Forum Timeline: Datagrid, SQL and save button





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC