I’d like to set the timeout on a specific Session Variable in a .Net web application, but leave other Session variables alone. Is this possible?
Example:
I have 5 Session Variables
Session(var1) Session(var2) Session(var3) Session(var4) Session(var5)
I want to set it so that Session(var1) through Session(var4) have a timeout of 8 hours (480 minutes), but Session(var5) has a timeout of 20 minutes. Can it be done?
You may implement this feature by creating timestamp field in this variable (or associated timestamp field). The timestamp will mark the time after which the variable becomes invalid. Of course you will have to handle the timestamp manually in your code (update it per hit, and remove it from session when it becomes invalid).