Skip to content
  •   Sunday, May 28, 2023
  • Advertise
  • Contact us
Yeah Hub

Yeah Hub

Kali Linux Tutorials | Tech News | SEO Tips and Tricks

  • Home
  • Tutorials
    • Kali Linux Tutorials
    • Metasploit Tutorials
    • Wireless Hacking
    • Android Hacking
    • PHP Tutorials
  • CTF Challenges
  • Q&A
    • CEHv11 – MCQ
    • CEHv10 – MCQ
    • CEHv9 – MCQ
    • Linux MCQ
    • Infosec Q&A
    • HTML Q&A
    • Wireless Q&A
    • Abbrevations
  • Contact us
  • Home
  • Tutorials
  • Stay Logged in WordPress for Longer Duration
Tutorials

Stay Logged in WordPress for Longer Duration

5 years ago
Nancy Culbreth

Creating HTML pages dynamically is one half of what a content management system (CMS) does: it takes chunks of code (your content) and pieces them together into a single HTML page. The other function of a CMS is to provide an easy way for you, the user, to manage all those chunks of content.

In a login page, remember me feature is used to preserve the login name and password entered by the user. And it can be populated in the login form at the time of login. It minimizes the user effort by preventing to enter login details for each time.

Also Read: Limit WordPress Comments Length Manually

By default, “Remember Me” option in the login page will keep you logged in for 2 weeks which means 1209600 seconds (14*24*60*60).

If you want to stay logged-in for longer duration, then copy and paste the following code in your theme’s functions.php file. (Pastebin Link)

/**
* Stay Logged in (Powered by Yeahhub.com)
*/
add_filter( ‘auth_cookie_expiration’, ‘stay_longer’ );
function stay_longer( $expire ) {
return 17280000; // 200 days in seconds (200*24*60*60)
}

With the help of unitconverter, you can easily convert the days into seconds.

If you want to achieve the same thing in PHP then you can use the following code.

<?php
if($_POST[“remember_me”]==’1′ || $_POST[“remember_me”]==’on’)
{
$hour = time() + 3600 * 24 * 200;
setcookie(‘username’, $login, $hour);
setcookie(‘password’, $password, $hour);
}
?>

Nancy Culbreth
Nancy Culbreth

Step by step hacking tutorials about wireless cracking, kali linux, metasploit, ethical hacking, seo tips and tricks, malware analysis and scanning.

Tags: stay logged wordpress, Wordpress, Wordpress code snippets, Wordpress css, wordpress hacking, Wordpress increase duration time, Wordpress increase login duration, Wordpress login duration, Wordpress login duration 2 weeks, Wordpress remember me increase, wordpress security, Wordpress theme functions.php, wordpress tutorials

Post navigation

Limit WordPress Comments Length [Manually]
Change Mac Address in Kali Linux (Permanently)

No.1 Best Web Hosting


DomainRacer Web Hosting

Yeahhub’s Best Stuff

Kioptrix All Levels CTF Challenges Certified Ethical Hacker Questions CEHv9

Online Safety Quiz Yeahhub

CISSP Question Bank MCQ

DOS Attack Types

Information Security Abbreviations

Python Built-in Functions

OVER 1000+ INFORMATION SECURITY Q&A

Useful Linux Commands

Wireless Networking Questions

Related Posts

Tutorials

How to stand out in an industry where everything seems to look the same

2 weeks ago
Nancy Culbreth
Tutorials

Learn How to Add Proxy and Multiple Accounts in MoreLogin

1 month ago
Nancy Culbreth
Tutorials

Can Jews and Evangelical Christians Co-Exist?

2 months ago
Nancy Culbreth
Tutorials

Advantages Of Using Opkey SAP Testing Services

7 months ago
Nancy Culbreth

You Missed

Articles

Gain the Competitive Edge with AdFlex: Your Ultimate Ad Spy Tool

1 day ago
Nancy Culbreth
Articles

Unlocking Business Growth: The Power of Professional SEO

1 day ago
Nancy Culbreth
Articles

How to Promote Traffic to Promote the Site

1 day ago
Nancy Culbreth
Articles

How To Personalize Your Customer’s Shopping Experience

2 days ago
Nancy Culbreth

Disclaimer

Yeahhub.com does not represent or endorse the accuracy or reliability of any information’s, content or advertisements contained on, distributed through, or linked, downloaded or accessed from any of the services contained on this website, nor the quality of any products, information’s or any other material displayed,purchased, or obtained by you as a result of an advertisement or any other information’s or offer in or in connection with the services herein.

Recent Comments

  • trool on SSLKILL – Forced Man in the Middle Attack – Sniff HTTPS/HTTP
  • web root on Top 20 High Profile Creation Backlink Sites – 2018 Update
  • daebak on How to Download Wistia Videos without any Tool
  • Daniel on How to Download Wistia Videos without any Tool
  • ulong jep on Exploitation of EternalBlue DoublePulsar [Windows 7 – 64bit] with Metasploit Framework

Latest Articles

  • Gain the Competitive Edge with AdFlex: Your Ultimate Ad Spy Tool May 27, 2023
  • Unlocking Business Growth: The Power of Professional SEO May 27, 2023
  • How to Promote Traffic to Promote the Site May 27, 2023
  • How To Personalize Your Customer’s Shopping Experience May 26, 2023

Newsletter

Copyright © All rights reserved | Theme by Mantrabrain