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.

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:

HttpCookie _cookie = new HttpCookie("MyCookie");

_cookie.Value = _userId.Text; //Whatever captures your user's id for authentication - a textbox, whatever

string _test = _cookie.ToString(); //set a breakpoint here and make sure you have the value.

Hope that helps.

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.