Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialFredrik August Madsen-Malmo
16,261 PointsIncorporate delete method
Hey! Why did you not show how to make a clear/delete method? It takes two seconds extra and is really practical :)
Anyway, here is the code I used to accomplish this.
...
@app.route('/delete')
def delete():
flash('Deleted character')
response = make_response(redirect(url_for('index')))
response.set_cookie('person', '', expires=0)
return response
I set the cookie expiration date to 0 so that it expires when it's being created (therefor it will delete itself). This is the easiest way I found to delete cookies.
1 Answer
Alexander Davison
65,469 PointsGLITCH: This question is type of CSS.
Tagging Kara P and Rob Allessi