douzoudang1511 2015-08-25 07:29
浏览 51

使用tank_auth注册后,用户应该登录codeigniter

What is the best authentication out there for codeigniter, I decided to use tank_auth. It seems to be the best authentication for codeigniter.

So how can I, after registration user using tank_auth should be automatically logged in without requiring him/her to activate his/her account.

I have 4 step of registration process in my application so I need to add the user id into multiple tables. My Logice like at first step I want to I will directly login to user and then session id will be useful to other step.

  • 写回答

1条回答 默认 最新

  • 普通网友 2015-08-25 07:36
    关注

    My Logice like at first step I want to I will directly login to user and then session id will be useful to other step.

    Having never used Tank_auth, I'm not sure how to implement this into their system, however it shouldn't be too difficult. Here's a quick example I whipped up, just for you...

    $data = array(
        'username' => $username,
        'email' => $email,
        'password' => $hashed_password
    );
    
    $query = $this->db->insert('users', $data);
    
    // Use this for each table
    $user_id = $this->db->insert_id();
    

    Then you can do whatever with the database, linking the user by their id $user_id

    The session can be set once you have this ID

    评论

报告相同问题?

悬赏问题

  • ¥15 微信公众平台自制会员卡可以通过收款码收款码收款进行自动积分吗
  • ¥15 随身WiFi网络灯亮但是没有网络,如何解决?
  • ¥15 gdf格式的脑电数据如何处理matlab
  • ¥20 重新写的代码替换了之后运行hbuliderx就这样了
  • ¥100 监控抖音用户作品更新可以微信公众号提醒
  • ¥15 UE5 如何可以不渲染HDRIBackdrop背景
  • ¥70 2048小游戏毕设项目
  • ¥20 mysql架构,按照姓名分表
  • ¥15 MATLAB实现区间[a,b]上的Gauss-Legendre积分
  • ¥15 delphi webbrowser组件网页下拉菜单自动选择问题