Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you refer to the currently logged user in your code?

In other words - what would be a good name for a variable that references the currently logged user?

I've come up with a few:

  • logged_user
  • visitor
  • me

I'm not convinced either of them is good enough though.

like image 337
Emanuil Rusev Avatar asked Oct 22 '25 14:10

Emanuil Rusev


2 Answers

current_user seems the obvious choice.

like image 127
JoeC Avatar answered Oct 26 '25 01:10

JoeC


Either theUserWhoLoggedInAFewMinutesBeforeAndWhoHasNotYetLoggedOutAgain or just ich

like image 26
Ingo Avatar answered Oct 26 '25 02:10

Ingo