## Part 1
# go to {nav Configuration > Website > Advanced} section
# ensure that "Keep "Session Log" for" is set to "Forever"
# ensure that "Track database changes to change log" is checked, save
# log out
# log in
# log out
# log in
# go to {nav Tools > Query Database} section
# launch SQL like: `UPDATE inp_UserSessionLogs SET SessionEnd = -5 WHERE NOT ISNULL(SessionEnd);`
# go to {nav Logs & Reports > Session Log} section
# confirm, that Session end date for all ended sessions is about 01/01/1970
# run `in-portal scheduled-task:run rotate_session_logs` command from shell while in the project directory
# go to {nav Logs & Reports > Session Log} section
# confirm, that oldest sessions remains in the list
## Part 2
NOTE: Please repeat below steps for each of "Keep "Session Log" for" values, excepting "Forever". That is - for 1 day (86400 seconds), 1 week (604800 seconds), 2 weeks (1209600 seconds), 1 month (2629800 seconds as average), 3 months (7889400 seconds as average), 1 year (31557600 seconds as average), 2 years (63115200 seconds as average), 3 years (94672800 seconds as average), 5 years (157788000 seconds as average) values of "Keep "Session Log" setting.
# go to {nav Configuration > Website > Advanced} section
# ensure that "Keep "Session Log" for" is set to "1 week"
# change "Enable SEO-friendly URLs mode (MOD-REWRITE)" setting, save
# go to {nav Logs & Reports > Changes Log} section
# confirm, that last change of Configuration is in the list
# log out
# log in
# go to {nav Tools > Query Database} section
# launch SQL like "UPDATE inp_UserSessionLogs SET SessionEnd = UNIX_TIMESTAMP() - #seconds# WHERE NOT ISNULL(SessionEnd)", where #seconds# must be replaced with corresponding integer value from note above
# go to {nav Logs & Reports > Session Log} section
# confirm, that Session end date for all ended sessions is about ("Current Date" - "period, selected from note above for test")
# run `in-portal scheduled-task:run rotate_session_logs` command from shell while in the project directory
# go to {nav Logs & Reports > Changes Log} section
# confirm, that list is empty
# go to {nav Logs & Reports > Session Log} section
# confirm, that only current session is in the list
## Part 3
# make 2 or more outdated sessions with change log records (login and logout several times, make some changes and save)
# launch SQL like "UPDATE inp_UserSessionLogs SET SessionEnd = -5 WHERE NOT ISNULL(SessionEnd)"
# go to {nav Logs & Reports > Session Log} section
# confirm, that Session end date for all ended sessions is about 01/01/1970
# go to {nav Configuration > Website > Advanced} section
# ensure that "Keep "Session Log" for" is set to "1 week"
# change system code temporarily - set $limit = 1 in place of $limit = 100 in SessionLogEventHandler::OnRotate event
# run `in-portal scheduled-task:run rotate_session_logs` command from shell while in the project directory
# go to {nav Logs & Reports > Session Log} section
# confirm, that only current session is in the list
# go to {nav Logs & Reports > Changes Log} section
# confirm, that only last session changes are in the list
# restore system code - set $limit = 100 in SessionLogEventHandler::OnRotate event