Session?

Options
Hi 

I would like to set some cookies with a session id in the frontend, is there any best practice to store the session key and value in xano database?  

can I set a TTL in the session table and the database will auto prune it periodically?  If not, does xano has a scheduler to trigger jobs that can delete them ?

Regards
Joe

Comments

  • Joe Thong
    Joe Thong Member
    Options
    OK Nevermind, i decided not to use a table to do that, instead I opted for the cache service from m3o.com

    This is the CURL that they gave us

    curl "https://api.m3o.com/v1/cache/Set" -XPOST -H "Authorization: Bearer INSERT_YOUR_TOKEN_HERE" -D '{
      "key": "",
      "ttl": 0,
      "value": ""
    }'

    It seems like I can't import this into Xano using the "Import CURL" feature. 
    This is what I get
    [CleanShot 2021-06-19 at 05.00.20@2x.png]
    It seems like Xano could not import the JSON code, maybe its because of the newlines?

    Any help would be much appreciated.

    Thanks
    Joe
  • Sean Montgomery
    Sean Montgomery Administrator

    ADMIN

    Options
    Hey Joe,

    It looks like the CURL importer got tripped up on your command line. Manually change the ENUM method on your request to POST and it should fix your issue.
  • Joe Thong
    Joe Thong Member
    Options
    Hi Thanks Sean!  why enum though?   i imported the json manually and it worked.  Is this a valid method?

    [image.png]
    Related question, is there a templating semantic to get xano to replace $remote_ip with the value of $remote_ip?    something like {$remote_ip}