<p>In Craft, there is no difference between the currently logged in user in the CP, and the currently logged in frontend user. Whenever a user logs in (be it through a frontend form, or the CP login page), it results in that user being logged in. Period. There's no 'being logged in in the frontend', as far as Craft is concerned.</p>

CC BY-SA 4.0
2019-04-16T08:55:37.613Z
Thank you. I understand how it works now :)
André Castro
CC BY-SA 4.0
2019-04-16T08:18:32.437Z
2019-04-16T08:18:32.437Z
Paul
<p>I'm using Craft Pro to make a website where users have a private area. Users register and when login happens they are redirected to a page in the private area with respective info about that user.</p>

<p>When i use <code>{% requireLogin %}</code> with <code>{{ currentUser.id }}</code> Craft 3 outputs the ID of the user that has active login in the CP (control panel).</p>

<p>But what I need is the ID of the user that made login in the frontend to access private area and not user ID that is logged in CP.</p>

<p>I'm reading the Craft 3 docs but I didn't find the answer I'm looking for.</p>

<p>Any suggestions?</p>

CC BY-SA 4.0
2019-04-16T08:14:28.170Z
The logged in user on the front and and the control panel are the same - the only difference is whether that user has permission to access the control panel. If I'm reading your question right, are you saying that a user logs in to look at another user's data, not their own?
darylknight
CC BY-SA 4.0
2019-04-16T08:23:42.140Z
No. Users can register in the frontend, and then can fill a login form where they will be able to submit PDF files that can be read by the admin in control panel. How can i get that particular just logged in user profile in frontend?
André Castro
<templating><craft3><login>
How do you get the user id on the front-end?
# How do you get the user id on the front-end?

(Asked by: username_0 on 2019-04-16)

I'm using Craft Pro to make a website where users have a private area. Users register and when login happens they are redirected to a page in the private area with respective info about that user.

When i use `{% requireLogin %}` with `{{ currentUser.id }}` Craft 3 outputs the ID of the user that has active login in the CP (control panel).

But what I need is the ID of the user that made login in the frontend to access private area and not user ID that is logged in CP.

I'm reading the Craft 3 docs but I didn't find the answer I'm looking for.

Any suggestions?

**Tags:** templating, craft3, login
> **Comments:**
> **username_1**: The logged in user on the front and and the control panel are the same - the only difference is whether that user has permission to access the control panel. If I'm reading your question right, are you saying that a user logs in to look at another user's data, not their own?  
> **username_0**: No. Users can register in the frontend, and then can fill a login form where they will be able to submit PDF files that can be read by the admin in control panel. How can i get that particular just logged in user profile in frontend?  

---

## 1 answers

### Answer by username_2 on 2019-04-16. Score: 1 | Accepted answer

In Craft, there is no difference between the currently logged in user in the CP, and the currently logged in frontend user. Whenever a user logs in (be it through a frontend form, or the CP login page), it results in that user being logged in. Period. There's no 'being logged in in the frontend', as far as Craft is concerned.

> **Comments:**
> **username_0**: Thank you. I understand how it works now :)  

---

