0

I am trying to read a file that is stored locally on a mobile device. I'm having trouble knowing where to store it. Read/Write it from. Should the file be right with the config.xml or stored in the www area on device.

Ultimately the web app is being all served from webpages. But I want to store their login information to do auto logins really.

So read the file : logset.txt

I want to read it by and do a cflocation for auto login:

<cfset fc = #fileRead(expandPath("/logset.txt"), "utf-8")#>

Then if no login settings. Present them a form and write the file, then cflocation to login.

<cfset fpath = expandpath('\')>

<CFFILE ACTION="Write"
  FILE="#FPath#logset.txt"
  nameConflict="overwrite"
  OUTPUT="#nf#">

This all works on the web. But I need it to write the local file to the device and read it from the device. Path issue is what I need sorted I guess.

rrk
  • 15,677
  • 4
  • 29
  • 45
Merle_the_Pearl
  • 1,391
  • 3
  • 18
  • 25
  • 2
    You will need to use cookies for this. – Dan Bracuk Nov 02 '20 at 21:15
  • 1
    Never store login credentials! Use cookies to store some login token as Dan recommended. And remember, ColdFusion runs on the server so it cannot write a file to a mobile device. – Miguel-F Nov 03 '20 at 13:12
  • So use the cookie instead of the session variable? If they lose connection? Change wifi/mobile - will it retain the cookie information? – Merle_the_Pearl Nov 05 '20 at 18:54

0 Answers0