Skip to content

Commit 7a895b1

Browse files
committed
Report log after taking action
Signed-off-by: Ivan Kanakarakis <[email protected]>
1 parent 7f5f0a1 commit 7a895b1

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/satosa/state.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,19 @@ def state_to_cookie(state, name, path, encryption_key):
5050
cookie_data = "" if state.delete else state.urlstate(encryption_key)
5151
max_age = 0 if state.delete else STATE_COOKIE_MAX_AGE
5252

53-
msg = "Saving state as cookie, secure: {secure}, max-age: {max_age}, path: {path}".format(
54-
secure=STATE_COOKIE_SECURE, max_age=STATE_COOKIE_MAX_AGE, path=path
55-
)
56-
logline = lu.LOG_FMT.format(id=lu.get_session_id(state), message=msg)
57-
logger.debug(logline)
5853
cookie = SimpleCookie()
5954
cookie[name] = cookie_data
6055
cookie[name]["samesite"] = "None"
6156
cookie[name]["secure"] = STATE_COOKIE_SECURE
6257
cookie[name]["path"] = path
6358
cookie[name]["max-age"] = max_age
59+
60+
msg = "Saved state in cookie {name} with properties {props}".format(
61+
name=name, props=list(cookie[name].items())
62+
)
63+
logline = lu.LOG_FMT.format(id=lu.get_session_id(state), message=msg)
64+
logger.debug(logline)
65+
6466
return cookie
6567

6668

0 commit comments

Comments
 (0)