Delete session key from all users

前端 未结 3 1216
慢半拍i
慢半拍i 2020-12-10 15:23

When a user logs in some details are saved to the session, lets say using key=\'user_settings\'

When some updates happens within the system I need to loop through al

3条回答
  •  有刺的猬
    2020-12-10 15:44

    You can delete the key from the session like any other dictionary.

    del request.session['your key']
    

    for more info check this out

    How do I delete a session key in Django after it is used once?

提交回复
热议问题