Is it possible to set the timeout of a session variable to say one hour programatically.
How would I go about in doing this?
The reason I am asking is because of storing the contents of an arraylist into a session variable and these contents needs to be available way beyond the current timeout of the session variable.
No, because the timeout works for the entire session.
But you can set an artificial expiration time for the session item and increase the session max idle time/timeout. Thus you can store an object like this:
And whenever you get the whole session item, you can check if it’s still valid or it has expired.