| | |
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
Views: 2155 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for C#
.net access ado.net algorithm array barchart bitmap box broadcast button buttons c# chat check checkbox class client code color control conversion csharp custom database datagrid datagridview dataset datetime degrees development draganddrop drawing encryption enum event excel file files form format forms ftp function gdi+ http httpwebrequest image index input java list listbox listener login mandelbrot math mouseclick mysql networking object operator oracle path photoshop picturebox pixelinversion post programming radians regex remote remoting richtextbox save saving 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





