douzuita7325 2015-06-25 13:01
浏览 33

登录模块电子邮件确认过程[关闭]

I am not very clear about the process, how email confirmation process be handled after user firstly register some website? E.g. I register some websites, then I will receive email for register confirmation in my own private email account, I have to trigger that Email link for a success and valid register. My question is, how is this done? Through the same SessionID or Cookie?

  • 写回答

2条回答 默认 最新

  • douduan7295 2015-06-25 13:06
    关注

    You can do it different ways.

    Step 1: Upon successful registration process insert the user details into a table and keep a field (say, is_verified) with default value zero.

    Step 2: After inserting the user details, get the unique id (You can set user_id as Auto increment value and use that). Remember to encrypt it so that the user can't guess what it is. Then prepare a link that will redirect the user to the activation script. eg. http://your_domain.com/activate.php?link=encrypted_link_is_added_here

    Step 3: Send that link as a confirm email message from your system.

    Step 4. When the user clicks on the confirm_link, will get redirected to your website. Then on the activate.php, add script to get the unique id from the url.

    Step 5: Decode the unique_id and use it to set the is_verified field to One (1)

    Note: In your login script don't forget to check whether the is_verified field is set to one, while checking login details. Otherwise the unverified users will also have access to the system.

    评论

报告相同问题?

悬赏问题

  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了
  • ¥50 切换TabTip键盘的输入法
  • ¥15 可否在不同线程中调用封装数据库操作的类
  • ¥15 微带串馈天线阵列每个阵元宽度计算
  • ¥15 keil的map文件中Image component sizes各项意思
  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 划分vlan后,链路不通了?
  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
  • ¥15 Vue3 大型图片数据拖动排序