Open patil215 opened 10 years ago
You might want to keep the time of the last request around, and we can make an assumption that the session expires after ten minutes. It's probably more, but this is a conservative estimate.
Then, when making a request, check the time differential, and if it exceeds a certain amount of time, you could log in again.
Alternatively, do a HEAD request to the gradebook URL, and see if that returns a 500 (RRISD) or some other error code for AISD. That's the sure-fire way of knowing if you're logged in or not, saves bandwidth, and is quite fast. (This is what the iOS app does.)
That was actually the way I was gonna implement it if this wasn't plausible! On Jan 29, 2014 10:15 PM, "Tristan Seifert" notifications@github.com wrote:
You might want to keep the time of the last request around, and we can make an assumption that the session expires after ten minutes. It's probably more, but this is a conservative estimate.
Then, when making a request, check the time differential, and if it exceeds a certain amount of time, you could log in again.
Alternatively, do a HEAD request to the gradebook URL, and see if that returns a 500 (RRISD) or some other error code for AISD. That's the sure-fire way of knowing if you're logged in or not, saves bandwidth, and is quite fast. (This is what the iOS app does.)
Reply to this email directly or view it on GitHubhttps://github.com/quickhac/qhac-common/issues/17#issuecomment-33659018 .
Currently, there isn't a simple way to check if a session has timed out. A method to easily check for session validity would be a helpful improvement.