Manipulate cookie on a site

morpheus93

Client
Регистрация
25.01.2012
Сообщения
1 058
Благодарностей
244
Баллы
63
Hi,

just need to manipulate a value from one cookie on a site. How can I handle this the best way?

Thx
 

morpheus93

Client
Регистрация
25.01.2012
Сообщения
1 058
Благодарностей
244
Баллы
63
Tried to do it with "profiles". Saved "profile" to disk, unzipped it and then there are two files, profilecookie and profiledata. But I need only manipulate the cookies, so I deleted the profiledata file (or tried to empty all between "<Profile count="1">"</Profile>) and zipped it to a "profilenew.zpprofile". But always got "Failed to process file". If I extract and rezip the saved profile without manipulation it works.
Is the "profile-way" the way manipulate cookies or is there a better way (e.g. Post request).

Thanks for your help.
 

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 715
Баллы
113

morpheus93

Client
Регистрация
25.01.2012
Сообщения
1 058
Благодарностей
244
Баллы
63
Also found another solution: Use "save profile" and then use 7zip command-line from within ZP (run external program) to extract and compress again the profile data after manipulation. The related values within the profilecookie.zpcookie file can be alternated like normal textfiles using regex. Hope this helps.
 

V Munich

Пользователь
Регистрация
20.02.2014
Сообщения
85
Благодарностей
3
Баллы
8
Could anyone share a code example of how you guys use 7-Zip in C# to extract the profile zip, and then compress it later?
 

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 715
Баллы
113
What for? Do you wanna extract cookie?
 

V Munich

Пользователь
Регистрация
20.02.2014
Сообщения
85
Благодарностей
3
Баллы
8
What for? Do you wanna extract cookie?
Yes.

I managed to do this by installing 7zip, copying its command-line .exe to my project's directory, then I made zenno create a .bat file with the following text:

Код:
7zG.exe x {-Variable.currentaccount-}.zpprofile -o"{-Project.Directory-}{-Variable.currentaccount-}"
Then after that I made zenno run the .bat, and it worked :-)

There's probably an easier way to do it using C#, but this was the way I found.

Oh, and promps to @bigcajones for helping me submit everything using post requests, he's the man!
 

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 715
Баллы
113
  • Спасибо
Реакции: bigcajones и V Munich

V Munich

Пользователь
Регистрация
20.02.2014
Сообщения
85
Благодарностей
3
Баллы
8

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 715
Баллы
113
:ar:
 

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)