Pages

Subscribe:

Ads 468x60px

Wednesday, December 7, 2022

How to set session object in python

 In python you can set session by calling session object to store data.

See the bellow code:

# import requests module
import requests
 
# create a session object
T = requests.Session()
 
# make a get request
T.get('https://web-healer.blogspot.com/ cookies / set / sessioncookie / 123456789')
 
# again make a get request
U = s.get('https://web-healer.blogspot.com/ cookies')
 
# check if cookie is still set
print(U.text)

No comments:

Post a Comment