| | |
How to track UserId using cookies?
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Aug 2006
Posts: 20
Reputation:
Solved Threads: 0
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.
•
•
Join Date: Jan 2008
Posts: 15
Reputation:
Solved Threads: 0
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:
Hope that helps.
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)
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.
![]() |
Similar Threads
- spydoctor? (Viruses, Spyware and other Nasties)
Other Threads in the C# Forum
- Previous Thread: question in C#
- Next Thread: Datagrid, SQL and save button
| Thread Tools | Search this Thread |
.net access ado.net algorithm array barchart bitmap box broadcast buttons c# chat check checkbox client color combobox control conversion csharp custom database datagrid datagridview dataset datetime degrees development display draganddrop drawing encryption enum event excel file files form format forms function gdi+ httpwebrequest image index input install java label list listbox listener mandelbrot math mouseclick mysql native networking operator path photoshop picturebox pixelinversion pixelminversion post prime programming radians regex remote remoting richtextbox save saving serialization server sleep socket sql statistics stream string table tcp text textbox thread time timer treeview update usercontrol validation view visualstudio webbrowser windows winforms wpf xml





