[Web development with Python] Precautions when saving cookies

If you want to save cookies in your browser, you can do it with the code below.

print (
    'Set-Cookie:{0}={1}; '
    'path=/; '
    'expires=Fri, '
    '5-May-2027 00:00:00 GMT;'.format(key, value))

If you execute it and execute another script, it cannot be saved. The expectation is that the http environment will change.

You can save it by redirecting, so save the cookie and redirect immediately.

Recommended Posts

[Web development with Python] Precautions when saving cookies
Precautions when using six with Python 2.5
Precautions when solving DP problems with Python
[Web development with Python] Measures against garbled characters when outputting html
[Web development with Python] query is also redirect
Precautions when dealing with control structures in Python 2.6
Explosive speed with Python (Bottle)! Web API development
Precautions when dealing with ROS MultiArray types in Python
Web scraping with python + JupyterLab
Web application development with Flask
Web API with Python + Falcon
Error when playing with python
Web scraping beginner with python
Streamline web search with python
Web application with Python + Flask ④
[Ipdb] Web development beginners tried to summarize debugging with Python
Precautions when using pit in Python
Web scraping with Python ① (Scraping prior knowledge)
Precautions when installing tensorflow with anaconda
Web application development memo in python
Getting Started with Python Web Applications
Web scraping with Python First step
I tried web scraping with python.
Get web screen capture with python
Othello game development made with Python
Precautions when creating a Python generator
Precautions when using phantomjs from python
When matplotlib doesn't work with python2.7
Prepare Python development environment with Atom
Application development with Docker + Python + Flask
[Python] Format when to_csv with pandas
Snippet when searching all bits with python
Precautions when pickling a function in python
Getting Started with Python Web Scraping Practice
Note when creating an environment with python
Daemonize a Python web app with Supervisor
[Personal note] Web page scraping with python3
Web scraping with Python ② (Actually scraping stock sites)
Download files on the web with Python
Horse Racing Site Web Scraping with Python
[Python] A quick web application with Bottle!
Getting Started with Python Web Scraping Practice
Easy web app with Python + Flask + Heroku
Run a Python web application with Docker
Let's make a web framework with Python! (1)
Practice web scraping with Python and Selenium
Easy web scraping with Python and Ruby
PNG saving is slow with Python imageio.imwrite
Let's make a web framework with Python! (2)
[For beginners] Try web scraping with Python
Notify slack when the switch sales page is updated ~ slack bot development with python ③ ~
Error when installing a module with Python pip
I got an error when saving with OpenCV
AWS-Perform web scraping regularly with Lambda + Python + Cron
Build Python development environment with Visual Studio Code
Python Web Content made with Lolipop cheap server
Personal tips when doing various things with Python 3
Introduction to Tornado (1): Python web framework started with Tornado
Start a simple Python web server with Docker
[Python] Precautions when assigning values to multidimensional arrays
[python] Quickly fetch web page metadata with lassie