How is this usually done?

M

Miguel Dias Moura

Hi,

When I subscribe a web site I usually receive an email to confirm my
subscription. Only after I follow the link in the email my account gets
activated.

In general, how is this done? Can you give me an idea?

(I am not asking for code.
I just need to have an idea of how this is usually done.)

Thanks,
Miguel
 
M

Marina

I would assume that there is some flag in the database that determines where
the account has been activated. When the user follows the link, the flag is
set to true, and the login code succeeds in checking that this flag is true.

As for the random URL, all you need is to create a url to a page that has a
query string parameter that is a GUID and another that is the username.
Store the GUID in another field in the user account row. The page should
read the 2 query string parameters and make sure they match in the
database - and set the flag described above to true.

At least this is the first plan that comes to mind without ever having
actually written something like this. I don't think there is one standard
way that this has to be done.
 
K

Kevin Spencer

Hi Miguel,

You'll notice that when you subscribe to a web site, that the email you
receive has a hyperlink in it. The hyperlink has a QueryString added to it,
which contains parameters identifying who you are (usually some form of
userid), and possibly some additional parameters as well. The link is
generated when the email is created, when you sign up for the web site. The
form handler for the submission form enters your information into a
database, and uses the ID from the database to construct an HTML email that
contains the link.

The link itself leads to another active page that reads the QueryString, and
updates your information in the database, verifying that the email address
you gave was correct. If it was not a valid email, you would not receive the
link, and could not click the link to activate your membership.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.
 
C

craigkenisston

In addition to Miguel question, I'd like to add, how do you actually
send the email ?
I mean, what component/class do you use to send the mail from inside an
asp.net application ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top