Page 1 of 1
Persistent Cookies for login
Posted: Wed Sep 26, 2018 5:33 am
by ruel.lago22
Hello everyone,
Just want to ask if anybody has tried using a persistent cookies for our login in WWB? I tried to convert my existing website made with WWB of course, into a mobile app for iOS and Android. It seems to work and everything is fine and goes the way I want it to be. But I am having an issue about the signed in users? They keeps from logging out when the browser/app is closed. I was advised to change the cookie to persistent (none expiring/permanent) cookie to prevent users from being logged out. Hope someone can share their script/code used on their WWB
Thank you in advance! God bless you all!
Re: Persistent Cookies for login
Posted: Wed Sep 26, 2018 5:58 am
by Pablo
You can set the (sessions) timeout for cookies in the properties of the login object.
A session timeout is implemented on the server (PHP), so it does not matter which browser is used.
Re: Persistent Cookies for login
Posted: Wed Sep 26, 2018 7:09 am
by ruel.lago22
Pablo wrote: ↑Wed Sep 26, 2018 5:58 am
You can set the (sessions) timeout for cookies in the of the login object.
I see, what values should I set there to set the cookies expiry to persistent/permanent cookies? Or if it's not possible, what values should I put there to make it last forever or the longest the cookies can stay? Thank you Pablo
Re: Persistent Cookies for login
Posted: Wed Sep 26, 2018 8:03 am
by Pablo
Note that this is not specific to the login tools.
See 'expires':
http://php.net/manual/en/function.setcookie.php
Re: Persistent Cookies for login
Posted: Wed Sep 26, 2018 8:27 am
by ruel.lago22
Thank you Pablo
I will look into it.
Re: Persistent Cookies for login
Posted: Sun Sep 30, 2018 12:22 pm
by ruel.lago22
***UPDATE***
It worked
If anyone needs persistent cookies that will last 10 years from now. Use the code below
Don't forget to convert the login tools to Form first to edit the source code! Thank you again Pablo!
Code: Select all
if ($rememberme)
{
setcookie('username', $_POST['username'], time()+10*365*24*60*60);
setcookie('password', $_POST['password'], time()+10*365*24*60*60);
}
Re: Persistent Cookies for login
Posted: Fri Oct 05, 2018 10:43 am
by ruel.lago22
***UPDATE***
Hello everyone,
I know this is no longer scope of support of Pablo, if anyone can help me with this. For sure I will not be the only one who needs this feature in the future.
I tried the code above and it worked for a little while. When I close my browser and after a few minutes, the cookies expires. I double checked it thru the browser cookies, and it's set to expire for my website after 10 years. I'm not sure why am I still being logged off. I don't clean cache and history data on my browsers. Even tried it using Google Chrome for Android and it's the same thing.
Website:
https://washub.ph
Username: 090909
Password: demo
Note: Remember me box is checked and it's default on my website. Please do not proceed to checkout. Website is live. Thank you in advance!
Re: Persistent Cookies for login
Posted: Thu Mar 28, 2019 10:08 am
by ruel.lago22
Up.