(self)
| 303 | os.unlink(fname) |
| 304 | |
| 305 | def new_session(self): |
| 306 | sid = str(uuid4()) |
| 307 | fname = safe_join(self.path, sid) |
| 308 | |
| 309 | while fname is not None and os.path.exists(fname): |
| 310 | sid = str(uuid4()) |
| 311 | fname = safe_join(self.path, sid) |
| 312 | |
| 313 | # Do not store the session if skip paths |
| 314 | for sp in self.skip_paths: |
| 315 | if request.path.startswith(sp): |
| 316 | return ManagedSession(sid=sid) |
| 317 | |
| 318 | if fname is None: |
| 319 | raise InternalServerError('Failed to create new session') |
| 320 | |
| 321 | # touch the file with mode 0o600 — see _open_session_file rationale. |
| 322 | with _open_session_file(fname): |
| 323 | return ManagedSession(sid=sid) |
| 324 | |
| 325 | return ManagedSession(sid=sid) |
| 326 | |
| 327 | def get(self, sid, digest): |
| 328 | """Retrieve a managed session by session-id, verifying integrity |
no test coverage detected