简体   繁体   English

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

[英]After registration using tank_auth user should get logged in for codeigniter

What is the best authentication out there for codeigniter, I decided to use tank_auth. 对于Codeigniter,最好的身份验证方法是什么,我决定使用tank_auth。 It seems to be the best authentication for codeigniter. 这似乎是对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. 因此,注册用户使用tank_auth后,我该如何自动登录而无需激活他/她的帐户。

I have 4 step of registration process in my application so I need to add the user id into multiple tables. 我的应用程序中有4个步骤的注册过程,因此我需要将用户ID添加到多个表中。 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. 我的Logice就像我想要的第一步一样,我将直接登录到用户,然后会话ID将对其他步骤有用。

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. 我的Logice就像我想要的第一步一样,我将直接登录到用户,然后会话ID将对其他步骤有用。

Having never used Tank_auth, I'm not sure how to implement this into their system, however it shouldn't be too difficult. 从未使用过Tank_auth,所以我不确定如何将其实现到他们的系统中,但是应该不会太困难。 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 然后,您可以对数据库执行任何操作,并通过其ID $user_id链接用户

The session can be set once you have this ID 拥有此ID后即可设置会话

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM