what's the best way to save sessions in a database?

Sailer

New Member
i'm planning on making my own custom session handling functions. i want to save it in the database but i have some doubts.
  • is it viable or will just slow down my app?
  • i have to save the session after each \[code\]set\[/code\] or can i just save it all at once? because i had this idea to put this function in the class destructor method. so, when the program ends, it will save the data in the database.
    • but how can i use my other class (database class) for this, being sure it won't be destructed before the session class?
    • if the user quits the connection and the app stops running, the destructor will still be called?
so, what do you guys think? what do you suggest me to do?
 
Back
Top