invalidate sessions after 4 hours
parent
3cfcef2ee6
commit
d1a8ee0ffc
|
@ -8,6 +8,7 @@ use RSSTootalizer::Feed;
|
||||||
use RSSTootalizer::Filter;
|
use RSSTootalizer::Filter;
|
||||||
use RSSTootalizer::User;
|
use RSSTootalizer::User;
|
||||||
use RSSTootalizer::Entry;
|
use RSSTootalizer::Entry;
|
||||||
|
use RSSTootalizer::DB;
|
||||||
|
|
||||||
our $config = "";
|
our $config = "";
|
||||||
open CONFIG, "rsstootalizer.conf.json" or die "Cannot open rsstootalizer.conf.json";
|
open CONFIG, "rsstootalizer.conf.json" or die "Cannot open rsstootalizer.conf.json";
|
||||||
|
@ -92,3 +93,5 @@ FEED: foreach my $feed (@feeds){
|
||||||
RSSTootalizer::Entry->create(%ne);
|
RSSTootalizer::Entry->create(%ne);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RSSTootalizer::DB->doUPDATE("UPDATE `users` SET session_id = 'invalid' WHERE TIME_TO_SEC(NOW()) - TIME_TO_SEC(`valid_from`) > 60*60*4;"); # invalidate old sessions
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
ALTER TABLE `users` ADD `valid_from` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER `session_id`;
|
||||||
|
UPDATE `users` SET `valid_from` = NOW();
|
Loading…
Reference in New Issue