nesis icon indicating copy to clipboard operation
nesis copied to clipboard

[Backend] Save last user's session

Open namwanza opened this issue 1 year ago • 0 comments

Description: We need to implement a feature in the backend that records and saves the last session data of each user. This will enable us to provide a better user experience by allowing users to pick up where they left off in case of session timeouts, disconnections, or logout.

Requirements:

  • Store Last Session Data:

    • Save critical session information such as user ID, timestamp, session duration, and any other relevant data needed to restore the session.
    • The session data should be stored securely in the database.
  • Session Retrieval:

    • Implement a mechanism to retrieve the last session data when the user logs back in or reconnects.
    • Ensure that only the most recent session is retrieved and used.
  • Data Expiration:

    • Define a reasonable expiration time for session data (e.g., 24 hours) after which it should be deleted to maintain database efficiency.
  • Security Considerations:

    • Encrypt session data if it contains sensitive information.
    • Implement proper access control to ensure that session data can only be accessed by the respective user.

Acceptance Criteria:

  • [ ] User's last session data is saved in the database upon logout or session timeout.
  • [ ] The system successfully retrieves and applies the last session data when the user logs back in.
  • [ ] Session data is deleted or archived after the defined expiration period.
  • [ ] The implementation adheres to security best practices, including encryption and access control.

Additional Notes:

  • Consider the impact of this feature on database performance and scalability.
  • Ensure that the implementation is compatible with existing session management systems.
  • Add unit tests and integration tests to verify the functionality.

Priority: Medium

Labels: backend, feature, session management, security

namwanza avatar Aug 22 '24 20:08 namwanza