0

I am using mojox::session with a PostgreSQL db. I have a expires column in the table. I am not sure the purpose of it. Basically, my question is how does the whole thing about expires work. How is session expired and how is the row in table deleted. Presently, I am manually deleting rows in the table.

Thanks.

PMat
  • 2,039
  • 2
  • 29
  • 46

1 Answers1

1

There seems to be no automatic cleanup, but if you expire your session and call flush afterwards the session will be deleted.

From the docs:

expire    
    $session->expire;
    $session->flush;

Force session to expire. Call flush if you want to remove it from the store.
dgw
  • 13,418
  • 11
  • 56
  • 54
  • Thanks, But my problem is, if the user has kept his browser open, and after 1 day, he comes back and his session and cookie is expired. There is no way to find and delete the row in the database. – PMat Apr 23 '12 at 17:52
  • If the user comes back, you could call `flush` to remove it. But otherwise you might consider building a admin function that loops over all sessions and invalidates expired sessions. – dgw Apr 23 '12 at 17:57
  • To call flush I need the sid, I don't have it, since the cookie i expired. How do i know if the session in expired looking at the table. Expires column does not tell, if the session is expired. – PMat Apr 23 '12 at 18:31