How to make joomla login never expires like Facebook?

Need help with the Administration of your Joomla! 3.x site? This is the spot for you.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Locked
skyfranky
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 102
Joined: Wed May 10, 2006 4:35 am

How to make joomla login never expires like Facebook?

Post by skyfranky » Fri Jun 03, 2022 3:52 pm

Hi

I want to make my joomla user login never expires like Facebook. Possible?

https://www.quora.com/Facebook-and-Gmai ... hieve-this

Thanks

User avatar
mjparadac
Joomla! Hero
Joomla! Hero
Posts: 2488
Joined: Mon Oct 29, 2012 3:58 pm

Re: How to make joomla login never expires like Facebook?

Post by mjparadac » Fri Jun 03, 2022 4:28 pm

Hello skyfranky

Browsers close sessions if you close them. That is simply because the server identifies the user through a cookie. Session cookies are usually set to live only for as long as the browser is open.

The solution for your problem is to use time based cookies instead. PHP can do this for you. You can do this with PHP code or by configuration.

More information
https://www.php.net/manual/en/session.c ... e-lifetime
https://www.php.net/manual/en/function. ... params.php
https://docs.joomla.org/J3.x:Global_con ... ings_Group
Joomla Community Ambassador for A2 Hosting | A2 Hosting - Our speed, your success | https://www.a2hosting.com/joomla-hosting

skyfranky
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 102
Joined: Wed May 10, 2006 4:35 am

Re: How to make joomla login never expires like Facebook?

Post by skyfranky » Sat Jun 04, 2022 12:56 am

Thanks for the reply.

I see some app or websites, even browser closed, login always valid until I manually click logout.

Joomla Session Lifetime can only set 9999 mins as maximum.

How to set never expires in Joomla with PHP?

Thanks

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 30890
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: How to make joomla login never expires like Facebook?

Post by Per Yngve Berg » Sat Jun 04, 2022 4:15 am


skyfranky
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 102
Joined: Wed May 10, 2006 4:35 am

Re: How to make joomla login never expires like Facebook?

Post by skyfranky » Sun Jun 19, 2022 1:56 am

mjparadac wrote:
Fri Jun 03, 2022 4:28 pm
Hello skyfranky

Browsers close sessions if you close them. That is simply because the server identifies the user through a cookie. Session cookies are usually set to live only for as long as the browser is open.

The solution for your problem is to use time based cookies instead. PHP can do this for you. You can do this with PHP code or by configuration.

More information
https://www.php.net/manual/en/session.c ... e-lifetime
https://www.php.net/manual/en/function. ... params.php
https://docs.joomla.org/J3.x:Global_con ... ings_Group
I set PHP as session handler in joomla config setting. Joomla Session Lifetime can only set 9999 mins as maximum. but it still logouts after that. nowadays, I see many websites never logs me out.

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 30890
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: How to make joomla login never expires like Facebook?

Post by Per Yngve Berg » Sun Jun 19, 2022 9:56 am

Session Keeper have a js script that access the site before the session expires.
The server have a cron job that purge session files at regular intervals. Don't set the session life to high, that will build up a lot of sessions on the server.


Locked

Return to “Administration Joomla! 3.x”