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!
Persistent Cookies for login
Forum rules
PLEASE READ THE FORUM RULES BEFORE YOU POST:
viewtopic.php?f=12&t=1901
MUST READ:
http://www.wysiwygwebbuilder.com/forms.html
http://www.wysiwygwebbuilder.com/form_wizard.html
Frequently Asked Questions about Forms
PLEASE READ THE FORUM RULES BEFORE YOU POST:
viewtopic.php?f=12&t=1901
MUST READ:
http://www.wysiwygwebbuilder.com/forms.html
http://www.wysiwygwebbuilder.com/form_wizard.html
Frequently Asked Questions about Forms
Re: Persistent Cookies for login
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.
A session timeout is implemented on the server (PHP), so it does not matter which browser is used.
- ruel.lago22
-
- Posts: 59
- Joined: Thu Feb 01, 2018 11:32 am
Re: Persistent Cookies for login
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
Note that this is not specific to the login tools.
See 'expires':
http://php.net/manual/en/function.setcookie.php
See 'expires':
http://php.net/manual/en/function.setcookie.php
- ruel.lago22
-
- Posts: 59
- Joined: Thu Feb 01, 2018 11:32 am
Re: Persistent Cookies for login
Thank you Pablo I will look into it.
- ruel.lago22
-
- Posts: 59
- Joined: Thu Feb 01, 2018 11:32 am
Re: Persistent Cookies for login
***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!
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);
}
- ruel.lago22
-
- Posts: 59
- Joined: Thu Feb 01, 2018 11:32 am
Re: Persistent Cookies for login
***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!
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!