Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Storing session or GUID in membership profile.

Posted on 2008-10-26
8
180 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
How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

 
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

856 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