Keep sessions logged

I’m creating a plugin for sketchup, the plugin shows an login screen, and while the sketchup is opened, this sessions keep opened, but if the user restart the program the login screen appears again, so, how can I keep a “logged” status during some days.
I tried do a hash, and when the user start the first login session, its create a hash and write in a database and inside the plugins folder, but, i dont know if this is the best practice.

To protect against a crash or the user closing SketchUp, you must save something persistent outside the active model. Your extension’s folder in Plugins is a reasonable place to put it. SketchUp’s encryption and signature system covers only Ruby code, so anything else won’t break it. Without knowing your security requirements or the nature of what defines a “login session” I can’t advise you about use of a hash or database, though that seems pretty heavyweight.