Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ブラウザーが最初にサーバーを要求すると、django はセッション obj を生成し、set cookie ヘッダーを書き込み、セッション ID を応答に Cookie として設定します。私の質問は、この新しく生成された sess id をアクセス request.COOKIES なしで取得する方法です。現時点では、最初の応答がまだ送信されていないため、クライアントは sessid を認識していないことに注意してください。ありがとう。
試す
request.session.session_key
うまくいかない場合はrequest.session.save()事前に
request.session.save()