8
Let's say you're implementing sessions.
You check whether the browser presents a session cookie. If yes, you authenticate the cookie and find the user that the session is associated with, and move on processing the request.
If you don't find a session cookie, you create a new session and send a cookie to the browser whch you expect to receive on subsequent requests.
Now my question is: if you did find a session cookie in a request, would you resend the same cookie in the response. Under what circumstances is this right?
Note: I ask this as a Pyramid (Python) programmer, because Pyramid implementation sends the session cookie unconditionally on every response. (go to code)