How to setup ‘Remember Me’ function

Hi,

Is there a tutorial on how to implement the ‘Remember Me’ function that is inserted in the login page?

I could find a step by step guide as part of the Login tutorial.

Any assistance would be great.

The remember me option sets a cookie when the users log in. So they are not logged in after the browser session ends.
It expects either a static value for example 1 or a dynamic value from an input/checkbox that when checked sends the value of 1

If the remember me option is not used, no cookie is set and the users will be logged out when the browser session ends.

1 Like

there are several ways to go about it. here is one,
in the front end you need a login form (convert to a server connect form) like blow;
image
you have to set checkbox value as below using dynamic attribute of it;


this will set the value of checkbox to true when checked.

then you will need a server action on server side to login the user. in its input you can select the login page and select your login server connect form and click import from from as below;


Then in the login server action execute add the step 'security login' and the properties of it has to be linked to posted fields you got from the import;
image

Note this is basic. There is a lot more you can do as you advance. also for security login to work you need to setup a security provider in the project globals. Hope this covers your question.

The checkbox needs a static value of let's say 1
No need of dynamic attributes. Checkboxes only send their values if checked.

2 Likes

Thanks @Teodor and @beejan01
I set the checkbox to a static value of 1
So I dont have to set cookie settings etc?
Is it just as easy as that?
Where can I adjust the timeout duration?

You can setup the cookie expiration in the Security Provider properties:

Excellent. Got it.
and just checking I dont have to specify the domain or path? I can leave them blank and just change the Expire field

I think you need to do that if you are depending on cookies to manage aspects on client side. i prefer not to set cookies so i leave them blank. if you search on the topic, you will come across how it improves cookie security.