get_currentuserinfo();
$username = $current_user->user_login
That should work to get the current user’s username. You can read more about get_currentuserinfo();
here in the codex. It pulls all the base info about a user – username, display name, email, first/last name, and user ID.
This will be handy since you can verify the user based on username, then assign the key in the DB according to UID.
Related Posts:
- Can’t log in: “ERROR: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress.”
- Login page ERROR: Cookies are blocked due to unexpected output
- Removing username from the ‘wordpress_logged_in’ cookie
- Getting “Cookies are blocked or not supported by your browser” on login page
- Cookie settings for session across WPML subdomains using custom AJAX login
- Login redirect_to loop with reauth=1, cookie expiry set to 1 year in past
- Get user ID after logging in
- Login with cookie but without using WordPress code
- Get wordpress stored cookies for custom login
- How to get login data (session) outside WordPress?
- Login cookie across multiple domains on network w/ mapping
- Can’t login after URL change
- How to set different cookies for logged in admin users and logged in non admin users?
- 2 wordpress blogs with 1 users table and 1 login
- Logins through alias
- v5.6.2 User cannot stay logged in – wordpress_test cookie placed but not auth cookies
- Removing wordpress cookie from non-wordpress site
- One time login on 2 different WordPress sites
- How to force “remember me” users to login again?
- Multiple issues with Ajax login function due to browsers and cookies
- Sharing a logged in session with a custom subdmain site?
- Get WordPress logged in username from root domain when WP is installed in a subfolder
- wp-cron event doesn’t run when custom login API is enabled
- Extend Cookie with auth_cookie_expiration not working
- Custom login method appears to ignore auth_cookie_expiration
- Why deleting/removing cookies in WordPress does not log me out from admin?
- Cookies error during first time login attempt
- Opening protected page with cookie?
- WordPress Cookies – wp_set_auth_cookie
- Why doesn’t the “Remember Me” checkbox work for me on a live website? Only works on a local server environment
- Share login status across subdomains without network
- How to remove without touching the pluggable.php the wordpress_logged_in cookie to show the username on login?
- Can I programmatically login a user without a password?
- How to login with email only no username?
- Woocommerce registration page [closed]
- Share login data/cookies between multiple installations
- Is it possible to sign in with user_email in WordPress?
- Email address or username used to login in wordpress
- How to customise wp-login.php only for users who are setting a password for the first time?
- Websites defaced by uploading script using theme editor
- User Login Form Outside the Default wp-login Form
- I am not able to login to my wp-admin panel
- Block Logged-Out User Access to Directory Outside of WordPress using .htaccess and PHP file
- how to logout user on browser tab or window closes
- Making a client page
- Auto login user with link from Mail
- To be able to login as different user
- How do I Create Forums with bbpress Plugin that can only be Viewed by Logged in Users
- Can’t Login to WordPress, No Data Received Error
- how to restrict user login whenever if a user puts on hold by editing wp-login action?
- How to redirect to specific BLOG Dashboard (after login to Multi-Site)
- Why is my cookie not unsetting upon logout? [closed]
- Redirect wp-login
- Show reCaptcha on Custom Frontend Login & Register Form [closed]
- Auto Login After Registration
- Problems with is_user_logged_in() | Function in WP
- Changed Wordress Address URL Accidently
- Is the login encrypted before it is sent? If so how to do I encrypt it the same way?
- What speaks against using a custom login.php / register.php to wordpress?
- Input sanitation
- Advice on redirect to lock site from unauthorized users
- Sending new registration meta values to admin by email
- Single Time Login HELP
- Allow Access to Home Page and Login Screen but Nothing Else (unless logged in)
- Error on WordPress Login
- Reloading page with a query string upon login for admins
- force login loophole
- Custom login page problem!
- Get WordPress login functions without printing anything
- Allow login only for one account from one device
- URL with login details included for public members
- woocommerce store login not working at first time
- How is it possible to current user info on page in WordPress?
- Trouble when I try to connect to WordPress
- Custom failed login error messages for users based on user role?
- Recognize custom login page as wp-login.php
- Set logged in user based on API response
- Can’t login to wordpress, got ERR_EMPTY_RESPONSE after a few minutes
- Create a login page which redirects to a specific page?
- wp_signon works localhost but not wokrs https site
- how to add social login option in wordpress
- Allow log in to the dashboard only from specific gadget?
- How to use google api for wordpress login
- Can we start session from another php site to wordpress blog site?
- display last login date in the frontend
- Log in to wordpress after executing another form function
- Disabling the login form and redirect users on logout without headers sent php warning
- WordPress keeps redirecting to an unsecure connection?
- A way to redirect users when they log in based on their current page
- Webpage not found upon entering wrong username and password on custom login form?
- changing WordPress login page
- Where do I find “log in” and “register” link which are located on the top right corner?
- Check to see if there a wordpress user account and create one if not outside of wordpress
- User not logged first time I open the homepage
- WordPress Login Box horizontal at the top.
- How to limit user to login only once per session
- How to make WordPress keep me signed in? [duplicate]
- How to resolve these findings from security audit
- how to add custom word press regisration form in word press 3.5 with out module [closed]
- make a login system for site visitors