It doesn't matter how long it's active either, unless you use it to track users activity elsewhere
However, as you say, it might be allowed by GDPR without requesting extra approval, depending on the way that it's being used and who it is shared with?
Hence my question about whether the length of time that you store this data legally matters (because since databases can be stolen, it eventually does). Compare with how ISPs must store all your connection logs for a specific amount of time.
Length of time you store the data doesn't matter, except in the sense where you can prove that effectively you do not store it at all - for example by anonymization of logs so that you do not effectively store IP addresses, even if of course they have to exist in full in the system at some point to keep the connection open.