changed session from file to database