Increase 'Remember Me' to 2 weeks

Hi all,

I am trying to implement this snippet of JS from the Knack site to increase the ‘Remember Me’ time to 2 weeks

When I add it it stops the previous sections from working (these change the logo on when saved to the homescreen of mobile devices). I expect it is something fairly simple and obvious - any suggestions welcome…

Many thanks

/* Change the favicon to an image saved on the database. */

function ChangeFavicon() {
var link = document.querySelector(“link[rel*=‘icon’]”) || document.createElement(‘link’);
link.type = ‘image/x-icon’;
link.rel = ‘shortcut icon’;
link.href = ‘’; //path to your icon

/* Change the below icons to your personalized icon links. */

/* Change the ‘Remember Me’ to 2 weeks from 48 hrs. */
curl -H “Content-Type: application/json”
–data ‘{“email”:“email address”,“password”:“password”,“remember”:true}’

Good morning @Hugo

The curl command won’t work in JavaScript. Instead you want to use an ajax request. Here is an example of an ajax request:

// change "scene_1" to the scene you want to listen for
$(document).on('knack-scene-render.scene_1', function(event, scene) {
  // change scene_1 and view_1 to the view that works with the logged-in user
    url: '',
    type: 'GET',
    headers: {
      'Authorization': Knack.getUserToken(),
      'X-Knack-Application-Id': Knack.application_id,
      'Content-Type': 'application/json'
    success: function(data) {
      alert('Got records!')

The above code would need to be updated to fit your purposes.

However hopefully that helps get you in the right direction.

Thanks for that, I’ll give it a go and see how I get on.


@Hugo By the way I meant to ask you—Are your users logging in remotely or through the app as usual? If your users are logging in through the app then Remember Me is already 2 weeks. The documentation you shared is only necessary for remotely logged-in users. In your case it’s probably unnecessary. Cheers


through the app as usual. It is strange, I am sure it is logging me out (on my iPhone almost daily - I’ll make a point of checking this to be sure. It is on mobile devices I am trying to extend the duration for, not PCs - apologies if that wasn’t clear previously.


On mobile the 2 week rule is not enforced, it seems to logout daily.