You need to set below code in else condition
wp_clear_auth_cookie();
wp_set_current_user($user_verify ->ID);
wp_set_auth_cookie($user_verify ->ID, true);
hope this will help you and let me know if this is help or not
Related Posts:
- Change the login button on the login page
- Custom ReCaptcha Login
- What is the proper way to apply the login_form_bottom filter?
- How to override wp-login.php
- Remove Links from Login page
- setting a specific home page for logged in users
- Change “logged in” link in (you must be logged in to post a comment)
- Redirect to requested page after (custom) login
- Customizing the default logout page of WordPress
- How do I remove the eye icon that shows visibility on login screen and reset password screen
- Custom Login and Registration form in Ajax
- Last time a user logged in
- How can I allow access to multiple users, using the same login, at the same time?
- WordPress custom login page
- Adding a login form that concatenates three fields into a username
- Properly customizing login/register form
- How to add an extra variable to login and authenticate it?
- Login/Logout Session Sharing – Multiple WordPress Installations
- Custom login with external provider iframe and data object
- Deep customization of wp-login.php
- User can not login
- Lost password empty field error redirect to custom login
- Custom Log In Screen – Disable password recovery [duplicate]
- Multi-site User Sessions
- A truely custom login page?
- Switch between WordPress websites easy for an end user
- Lost password and back to blog in same line
- I w’d like to know If there are simple solutions to integrate other CMSs to wordpress
- Restrict content access to logged in users
- Custom login and registration forms
- URL and Site title outputting on Login page
- Is it possible to integrate a custom login feature with wordpress?
- How to change the login page without a plugin and not only customizing logo and text around the form?
- Removing “Failed” query argument upon successful login
- Validate user login in php
- how to change the url rediction of the woocommerce login page of the flatsome theme for my own in wordpress?
- How to change Login default blue admin color?
- Latest update broke my custom login CSS
- Wrap WordPress Login Form in custom Div
- Custom login doesn’t stay
- Check get_post value after wp-admin login
- where can i find the login page in wordpress and add my header to it
- Change the default WordPress image on the dashboard login to a custom image [duplicate]
- Pass the post ID
- Show Site Name on WP login screen
- how to manage Session in WordPress using custom login?
- Redirect all pages to the custom login page except for the registration page
- How to stop login for SPECIFIC users BEFORE a specified date
- get post author id outside loop
- WordPress Paginate $wpdb->get_results
- How to redirect WordPress home page to custom static HTML page
- Modify custom Users Manage page
- How to change in customizer the “site identity” tab required capabilities
- Are there any ‘Coming Soon’ themes for WordPress 3.0?
- How to hide WordPress files / structure? [closed]
- Customizer: How do you add HTML to control labels?
- multiple comment text areas
- Remove Author Slug & Replace With Username
- How can I control an external php (with external database) page with WordPress?
- Updating Custom WordPress User Meta Field via REST API
- Defined Blogname Override?
- Not sure how I would go about doing this in WP.. related to custom tags
- TinyMCE custom dialog with selectbox not working
- Publishing html directly from ftp to wordpress
- Load more posts with multiple queries
- Get Date of custom field and use conditional logic
- Custom search to display results within same page
- change url for static files in /wp-admin with a cdn url
- Sub menu indicator that links to sub menu
- How can I have a common background color across multiple WordPress blocks?
- What requirements for ACF custom fields key and name properties?
- Removing blank space below header [closed]
- Custom Search on Custom Page while preserving the main search function
- If the image variable is specified, show image, if not no code
- Is there another way to customize a parent template file besides adding the file to a child theme?
- Replacing words in WordPress or theme (not in content)
- How can I tag a menu item as visited for each unique user?
- Many Rewrite Parameters/Rules
- Adding other links on header than LinkedIn, Facebook, Youtube etc
- Custom Taxonomy Sort For a Custom Query
- kitchen sink not working
- Is it possible to auto sharing post on social network from specifc categories or tags
- wp_insert_post custom taxonomy multiple Category not added
- Can’t upload format files on media library
- Remove Title and White Space in Twenty Twenty theme
- How to show Term ID beside Name Category with wp_dropdown_categories()
- How to have differents sites share the same tables of DB?
- How to add particular attribute of product in shop as well as home page
- Saving of Draft is failing
- Send default WooCommerce email when switching from custom order status
- Combine Categories & Custom Taxonomy
- How to access my WP site locally and publicly? [closed]
- A delete/trash all function?
- Why, when it comes to custom background and image, does ‘The first value registered’ win?
- Unable to retrieve data from multiple WordPress websites on same server
- Unable to show messages using ‘admin_notices’
- How can I add a Description column to the media library browser screen?
- Search a meta field for a value in all posts
- Single page template
- how to add a page