{"id":25039077,"url":"https://github.com/timnashcouk/tn-tame-session-defaults","last_synced_at":"2025-04-13T22:12:05.852Z","repository":{"id":221237466,"uuid":"753794584","full_name":"timnashcouk/tn-tame-session-defaults","owner":"timnashcouk","description":"Taming your WordPress user sessions, to help reduce the chance of session hijacking","archived":false,"fork":false,"pushed_at":"2024-02-17T21:37:43.000Z","size":7,"stargazers_count":7,"open_issues_count":2,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-10T08:11:04.736Z","etag":null,"topics":["wordpress","wordpress-plugin"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/timnashcouk.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-02-06T20:02:47.000Z","updated_at":"2024-09-24T11:53:41.000Z","dependencies_parsed_at":"2024-02-06T22:25:20.284Z","dependency_job_id":"1c4784b2-86c4-489a-81bc-47a699677dbc","html_url":"https://github.com/timnashcouk/tn-tame-session-defaults","commit_stats":null,"previous_names":["timnashcouk/tn-tame-session-defaults"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timnashcouk%2Ftn-tame-session-defaults","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timnashcouk%2Ftn-tame-session-defaults/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timnashcouk%2Ftn-tame-session-defaults/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timnashcouk%2Ftn-tame-session-defaults/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timnashcouk","download_url":"https://codeload.github.com/timnashcouk/tn-tame-session-defaults/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248788917,"owners_count":21161728,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["wordpress","wordpress-plugin"],"created_at":"2025-02-06T02:08:08.359Z","updated_at":"2025-04-13T22:12:05.830Z","avatar_url":"https://github.com/timnashcouk.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tame Session Defaults\nA very simple plugin that reduces the WordPress sessions lengths to be shorter. This helps prevents, session hijacking by reducing the window of opportunity to use gathered sessions.\nIn addition it provides a couple of other use features to prevent session hijacking:\n- Shortens sessions by default\n- Provide filters, to do fine grain control of session lengths (for example by user or user role)\n- Validates requests made against the stored session, logging out where the IP or useragent do not match\n- Optionally limits the number of sessions a user can have to 1\n\n## Install\nThis is probably best used as a MU Plugin, or consider simply taking the code and using in your own skeleton projects.\n\n## Usage\nBy default it sets the logged in time for a user to 2 hours from 2 days, and for a logged in user with the remember me ticked from 2 weeks to 24 hours. \n\nIt provides some filters to help fine tune this:\n\n### tn_tame_session_default\nThis is the session length it takes an integer that represents the expiry length in seconds. It passes the user_id of the logged in user.\n\n### tn_tame_session_default_remember\nThis is the session length if the remember me box is ticked it takes an integer that represents the expiry length in seconds. It passes the user_id of the logged in user.\n\n### tn_tame_session_limit\nThis is an optional filter that will destroy all other sessions, when a new session logs in. Meaning only a single session may occur at any given time. By default this is set to false, using this filter and setting to true will activate it.\n\n### tn_tame_session_validate_session\nThis is an optional filter that will check the IP/Useragent of the client and compare it to the stored session details, logging out the client if they do not match. This defaults to true, to disable set filter to false.\n\nIt also provides an action\n\n### tn_tame_session_non_valid\nThis action is triggered if a session is deemed to not be valid, useful to hook into for maybe notification or logging.\n\n## Changelog\nYou can see the CHANGELOG.md for up to date changes.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimnashcouk%2Ftn-tame-session-defaults","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimnashcouk%2Ftn-tame-session-defaults","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimnashcouk%2Ftn-tame-session-defaults/lists"}