Skip to content
  •   Sunday, January 29, 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

5 Windows 10 Features: How to Use Them

1 year ago
Nancy Culbreth
Tutorials

Some Useful PowerShell Cmdlets

2 years ago
Nancy Culbreth
Tutorials

Create Free SSL Certificate – ZEROSSL.COM [2020 Tutorial]

3 years ago
Nancy Culbreth
Tutorials

Generate Self-Signed SSL Certificate with OPENSSL in Kali Linux

3 years ago
Nancy Culbreth

You Missed

Articles

Everything You Need to Know About Brokers With Welcome Bonus

18 hours ago
Nancy Culbreth
Articles

Best new casino sites in India

18 hours ago
Nancy Culbreth
Tech Articles

How To Find Gaps In Your Cybersecurity And How To Address Them

3 days ago
Nancy Culbreth
Articles

How To Install ExpressVPN On Sony TV?

1 week 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

  • Everything You Need to Know About Brokers With Welcome Bonus January 28, 2023
  • Best new casino sites in India January 28, 2023
  • How To Find Gaps In Your Cybersecurity And How To Address Them January 26, 2023
  • How To Install ExpressVPN On Sony TV? January 19, 2023

Newsletter

Copyright © All rights reserved | Theme by Mantrabrain