Deleting a cookie by name #8548
-
So i want to delete a cookie by name. I got no problem accessing the cookies, i just can't figure out how to delete by name.
What i find a bit confusing is the
This to me sounds like it is removing more than one? Then in the explanation as to what the predicate parameter is, it states
There it sounds like only one Morsel will be removed. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Well, yes, the predicate is used to filter which ones to delete.
The predicate is going to be called once for each Morsel. This is a very standard approach seen across Python (e.g. the builtin filter() function). |
Beta Was this translation helpful? Give feedback.
-
So i ended up making this function I don't know if it is the most pythonic way of doing it, but it works rather good. I also made a small test file showing a few examples. Maybe someone else looking for a way of doing this, can use this to get on the right track, and not end up spending as long as i did. |
Beta Was this translation helpful? Give feedback.
Well, yes, the predicate is used to filter which ones to delete.
The predicate is going to be called once for each Morsel.
This is a very standard approach seen across Python (e.g. the builtin filter() function).