---
title: "Get Current user id in mvc"  
description: "Get Current user id in mvc"  
author: "Anonymous User"  
published: 2018-04-20  
updated: 2018-04-27  
canonical: https://www.mindstick.com/forum/34471/get-current-user-id-in-mvc  
category: "asp.net"  
tags: ["asp.net", "asp.net mvc"]  
reading_time: 1 minute  

---

# Get Current user id in mvc

I want current loged in UserId

How do I get the [current user](https://www.mindstick.com/forum/34063/how-to-index-view-record-information-only-current-user) inside a [controller](https://www.mindstick.com/blog/273/passing-values-from-controller-to-view-in-asp-dot-net-mvc) [class](https://www.mindstick.com/blog/165/generic-class-in-c-sharp) in [ASP.NET MVC](https://www.mindstick.com/forum/155798/what-is-caching-in-asp-dot-net-mvc)?

## Replies

### Reply by lukenlow lukenlow

Post is removed by the Admin.

### Reply by Anonymous User

if you are using web security then you can get current [user](https://www.mindstick.com/articles/13001/multi-statement-table-valued-user-defined-function-in-sql-server) id by this code

WebSecurity.CurrentUserId


---

Original Source: https://www.mindstick.com/forum/34471/get-current-user-id-in-mvc

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
