I've been trying to load raw cookies (not json) but using a txt file instead of declaring it directly inside a variable but getting no success , Here's my code ->
cookies.txt
{"PHPSESSID": "ibd1biktq4tfm3k4j790juf19d", "security": "impossible"}
my python script
file = open("cookies.txt", "r")
file = file.readlines()
str1 = " "
cookies = str1.join(file) # for converting list into string
requests.get("http://localhost/dvwa", cookies=cookies)
output : TypeError: string indices must be integers
Also if i do print(cookies) it outputs {"PHPSESSID": "ibd1biktq4tfm3k4j790juf19d", "security": "impossible"} and declaring the same output directly into the variable "cookies" works ...
Can anyone please clarify what i am doing wrong ?