JoeDog / siege

Siege is an http load tester and benchmarking utility
GNU General Public License v3.0
5.96k stars 385 forks source link

Feature request: Static cookies #33

Open insanebits opened 9 years ago

insanebits commented 9 years ago

Currently if response sends Set-cookie: header siege will set the cookie and next time use updated version of cookie instead of the one given via --header.

Need for such feature comes from CodeIgniter framework which doesn't use PHPSESSION cookie and has it's own ci_session value which is updated on each request and it l for some reason logs user out(this may be application bug instead, not sure).

Something like --static-cookies or --ignore-set-cookies switch would be nice :) And shouldn't be hard to implement.

JoeDog commented 9 years ago

Robertas,

Sorry, I was on vacation and I'm just catching up. I'm not opposed to adding --ignore-set-cookies but I need to give it a little thought.

Jeff

On Tue, Oct 6, 2015 at 10:22 AM, Robertas notifications@github.com wrote:

Currently if response sends Set-cookie: header siege will set the cookie and next time use updated version of cookie instead of the one given via --header.

Need for such feature comes from CodeIgniter framework which doesn't use PHPSESSION cookie and has it's own ci_session value which is updated on each request and it l for some reason logs user out(this may be application bug instead, not sure).

Something like --static-cookies or --ignore-set-cookies switch would be nice :) And shouldn't be hard to implement.

— Reply to this email directly or view it on GitHub https://github.com/JoeDog/siege/issues/33.

Petelin commented 7 years ago

Howevery,there is a bug, i use siege to test Django(python web framework), i use -H to set Cookie, the first request is fine, but response return some thing like "set-cookie: timeout=3600", then siege send two cookie like this

[('Host', 'localhost:8000'), ('Cookie', 'Max-Age=31449600'), ('Accept', '*/*'), ('Accept-Encoding', 'gzip;deflate'), ('User-Agent', 'Mozilla/5.0 (apple-x86_64-darwin15.6.0) Siege/4.0.2'), ('Cookie', '_ga=GA1.2.1535577474.1469622791; sessionid=t1s2ieavwv9xjpm4y67qj2j0gzarfbrm; ascle_session_key=zvji2nxplvfyfhnwhf6j3cyip7kjxdda; csrftoken=5eJsMOV726W7yYo1SAZBsfrf89IQDrPG'), ('Connection', 'close')]

django will fail to parse this cookie! Did the stander allow to have two Cookie in header?

JoeDog commented 7 years ago

I'm fairly certain this is covered in the documentation. Cookies can't be set with the -H option. You can probably solve this by using a $HOME/.siege/cookies.txt file. That's where persistent cookies are stored. You could probably dupe and edit an existing cookie to create the one you need.

74io commented 7 years ago

Could someone possibly give me an idea of the format the cookie needs to take in the cookies.txt file.

Everything I have tried results in:

[alert] Zip encoding disabled; siege requires zlib support to enable it Segmentation fault: 11

With nothing in the cookies.txt file everything runs fine. I know there are plenty of unresolved zlib questions out there.

PS. Thanks for this great tool!

JoeDog commented 7 years ago

While the segmentation fault is disheartening and needs to be corrected, that error doesn't seem to be related to your cookies issue. In fact, you might not have a cookies issue.

You are sending a accept-encoding that your copy of siege doesn't support. Something like this:

Accept-encoding: gzip

When this happens, the server sends compressed content over the wire. Siege is designed to decompress it and parse the content. But uh, oh, you didn't have zlib installed when you compiled it. I would recommend this:

Install zlib and zlib-devel and recompile siege. Then try again and see if you're problem isn't solved.

For the record, the cookies format will look something like this:

139689761183488 | Max-Age=7776000; domain=.facebook.com; path=/; expires=1511283460

On Tue, Sep 5, 2017 at 5:48 AM, 74io notifications@github.com wrote:

Could someone possibly give me an idea of the format the cookie needs to take in the cookies.txt file.

Everything I have tried results in:

[alert] Zip encoding disabled; siege requires zlib support to enable it Segmentation fault: 11

With nothing in the cookies.txt file everything runs fine. I know there are plenty of unresolved zlib questions out there.

PS. Thanks for this great tool!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/JoeDog/siege/issues/33#issuecomment-327127452, or mute the thread https://github.com/notifications/unsubscribe-auth/AFMT5vzyaxjDmYJOgVFgvRxcbWTklibAks5sfRj-gaJpZM4GJy4h .

JoeDog commented 7 years ago

One more thing:

What version of siege are you using? I don't want to track a bug that's already been fixed.

On Tue, Sep 5, 2017 at 8:34 AM, Jeff Fulmer jeff@joedog.org wrote:

While the segmentation fault is disheartening and needs to be corrected, that error doesn't seem to be related to your cookies issue. In fact, you might not have a cookies issue.

You are sending a accept-encoding that your copy of siege doesn't support. Something like this:

Accept-encoding: gzip

When this happens, the server sends compressed content over the wire. Siege is designed to decompress it and parse the content. But uh, oh, you didn't have zlib installed when you compiled it. I would recommend this:

Install zlib and zlib-devel and recompile siege. Then try again and see if you're problem isn't solved.

For the record, the cookies format will look something like this:

139689761183488 | Max-Age=7776000; domain=.facebook.com; path=/; expires=1511283460

On Tue, Sep 5, 2017 at 5:48 AM, 74io notifications@github.com wrote:

Could someone possibly give me an idea of the format the cookie needs to take in the cookies.txt file.

Everything I have tried results in:

[alert] Zip encoding disabled; siege requires zlib support to enable it Segmentation fault: 11

With nothing in the cookies.txt file everything runs fine. I know there are plenty of unresolved zlib questions out there.

PS. Thanks for this great tool!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/JoeDog/siege/issues/33#issuecomment-327127452, or mute the thread https://github.com/notifications/unsubscribe-auth/AFMT5vzyaxjDmYJOgVFgvRxcbWTklibAks5sfRj-gaJpZM4GJy4h .

74io commented 7 years ago

Many thanks.

Ryans-Air:.siege Air$ siege -V [alert] Zip encoding disabled; siege requires zlib support to enable it SIEGE 4.0.2

Copyright (C) 2016 by Jeffrey Fulmer, et al. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

JoeDog commented 7 years ago

I am unable to reproduce that segfault. Could you provide some insight as to what is leading up to it?

On Tue, Sep 5, 2017 at 8:34 AM, Jeff Fulmer jeff@joedog.org wrote:

One more thing:

What version of siege are you using? I don't want to track a bug that's already been fixed.

On Tue, Sep 5, 2017 at 8:34 AM, Jeff Fulmer jeff@joedog.org wrote:

While the segmentation fault is disheartening and needs to be corrected, that error doesn't seem to be related to your cookies issue. In fact, you might not have a cookies issue.

You are sending a accept-encoding that your copy of siege doesn't support. Something like this:

Accept-encoding: gzip

When this happens, the server sends compressed content over the wire. Siege is designed to decompress it and parse the content. But uh, oh, you didn't have zlib installed when you compiled it. I would recommend this:

Install zlib and zlib-devel and recompile siege. Then try again and see if you're problem isn't solved.

For the record, the cookies format will look something like this:

139689761183488 | Max-Age=7776000; domain=.facebook.com; path=/; expires=1511283460

On Tue, Sep 5, 2017 at 5:48 AM, 74io notifications@github.com wrote:

Could someone possibly give me an idea of the format the cookie needs to take in the cookies.txt file.

Everything I have tried results in:

[alert] Zip encoding disabled; siege requires zlib support to enable it Segmentation fault: 11

With nothing in the cookies.txt file everything runs fine. I know there are plenty of unresolved zlib questions out there.

PS. Thanks for this great tool!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/JoeDog/siege/issues/33#issuecomment-327127452, or mute the thread https://github.com/notifications/unsubscribe-auth/AFMT5vzyaxjDmYJOgVFgvRxcbWTklibAks5sfRj-gaJpZM4GJy4h .

74io commented 7 years ago

I quite simply entered a key value pair into the cookies.txt file (as I had no idea what format the file wanted). Eg. PHPSESSID = 9283465k2jh34b5k2hb43jkhwerf

Then the fragment error was raised. If I cleared the cookies.txt file it was fine. Both zlib and siege were installed via brew. However, zlib was not installed at the time I installed siege. I uninstalled siege, installed zlib and reinstalled siege. But I still get:

[alert] Zip encoding disabled; siege requires zlib support to enable it

I worked around this by not using the time var in siege.conf. I also worked around my cookie issue by using:

--header="Cookie: PHPSESSID=vlgsg16dngmojm3ovkr4h1dbf1"

Not tried installing zlib-devel yet though. I am on Mac OS 10.12.6

Thanks