![Picture of Manuel Lemos Picture of Manuel Lemos](/picture/user/1.jpg)
Manuel Lemos - 2015-10-16 21:29:17 -
In reply to message 1 from Eric Lu
What a coincidence! I just developed a sub-class to store and retrieve tokens to files. I will publish it soon.
The class uses file locking to prevent corruption caused by two scripts trying to write to update a token (for instance renewing an expired token).
The class is new so it is not yet well tested in practice. But if you use it by scripts that are not updating the same token file all the time, there is not problem with concurrent accesses.
Also if you use separate token files for different users of your application, the concurrent accesses will also practically eliminated.
Anyway, I plan to publish it and write an article about it later.