Solved

Storing session or GUID in membership profile.

Posted on 2008-10-26
8
173 Views
Last Modified: 2013-11-08
When the user enters the profile information.
Should I add this to the membership profile.

                string sConfirmationGUID = System.Guid.NewGuid().ToString("N");
                string sUserIP = Request.UserHostAddress;
                string sSessionID = this.Session.SessionID;

MembershipUser user = Membership.CreateUser(txtUserName.Text, txtPassword.Text, txtEmail.Text);

                ProfileCommon pc = Profile.GetProfile(user.UserName);
                pc.Email = txtEmail.Text;
                pc.FullName = txtFullName.Text;
                pc.DOB = Datepicker.Selected_Date.ToString();
                pc.Gender = Gender.ToString();

                pc.City = ddlCity.SelectedValue;
                pc.Region = ddlRegion.SelectedValue;
                pc.Country = ddlCountryRegister.SelectedValue;
====> put the information here for example.
                pc.Save();
0
Comment
Question by:mathieu_cupryk
  • 5
  • 3
8 Comments
 
LVL 20

Expert Comment

by:Juan_Barrera
ID: 22810371
In web.config, you can use allowAnonymous="true" in each profile property that you want to be able to store for anonymous users. Then, ASP.NET automatically does the job for you.
0
 
LVL 20

Expert Comment

by:Juan_Barrera
ID: 22810452
To add to my previous comment:
Obviously, if you want to store only authenticated user's profile information, there is no even need for setting the property.
0
 

Author Comment

by:mathieu_cupryk
ID: 22812537
This is authenticated users. What should I store from a programmer's point of view.
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
LVL 20

Expert Comment

by:Juan_Barrera
ID: 22816182
I'm not sure if I understand you question.
You can store whatever information you want, depending on your needs.
What I'm saying is that, in order for the Profile provider to work, is not necessary to store session IDs or user IPs, like in your exapmple.
Could you please clarify why you want to store that kind of information in the profile?
0
 

Author Comment

by:mathieu_cupryk
ID: 22817957
what does one usually store as information?
0
 
LVL 20

Expert Comment

by:Juan_Barrera
ID: 22817982
There is no "usually" I think. It depends on your needs.
0
 

Author Comment

by:mathieu_cupryk
ID: 22847289
if u need user information?
0
 
LVL 20

Accepted Solution

by:
Juan_Barrera earned 500 total points
ID: 22847618
The Proflie class is mainly used for that purpose.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

While working on Silverlight and WCF application, I faced one issue where fault exception occurred at WCF operation contract is not getting propagated to Silverlight client. So after searching net I came to know that it was behavior by default for s…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question