BUG: DestroySession sets MaxAge to -1 second instead of -1 #39
Labels
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sneak/upaas#39
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Severity: MEDIUM
File:
internal/service/auth/auth.goline ~234Description
time.Secondis1000000000nanoseconds. So this setsMaxAge = -1000000000, which is still negative and works to delete the cookie, but it's semantically wrong. The gorilla/sessions library expectsMaxAgein seconds, and the conventional value to delete a cookie is-1.The code works by accident (any negative value deletes the cookie), but it's confusing and could break if gorilla/sessions ever validates the range.
Suggested Fix
create a PR