Ticket #1053 (closed defect: fixed)
Session.timeToLive representation does not work in Python
| Reported by: | jmoore | Owned by: | jmoore |
|---|---|---|---|
| Priority: | minor | Milestone: | 3.0-Beta3.1 |
| Component: | General | Version: | |
| Keywords: | Cc: | callan, atarkowska, cblackburn |
Description
Currently timeToLive represents the number of milliseconds after session creation (started, in milliseconds since the epoch) which a session can still be accessed, or:
if (currentTime > sessionCreation + timeToLive) {
removeSession();
}
Currently, sessions (specifically OmeroShares) which are to persist forever, are given a value of:
Long.MAX_VALUE - sessionCreation
so that:
long time = System.currentTimeMillis();
long max = Long.MAX_VALUE;
System.out.println(max - time);
System.out.println(new Timestamp(max - time));
produces
9223370818800686547 292278956-01-11 11:51:26.547
When this value is transported to other systems, like python, the time libraries are unhappy:
time.ctime(creationTime/1000+t ) timestamp out of range for platform time_t
making display difficult.
Change History
Note: See
TracTickets for help on using
tickets.
