Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: cookie is not set if the host address is localhost:4320 #632

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

m-fedosov
Copy link

This solution is better than #631 since it sets a cookie even on a subdomain

@m-fedosov
Copy link
Author

Let's pull this one into master

@digininja
Copy link
Owner

digininja commented May 18, 2024 via email

@m-fedosov
Copy link
Author

Hmm, I don't see any comments.

@digininja
Copy link
Owner

digininja commented May 19, 2024 via email

@@ -4,6 +4,7 @@

if ($_SERVER['REQUEST_METHOD'] == "POST") {
$cookie_value = sha1(mt_rand() . time() . "Impossible");
setcookie("dvwaSession", $cookie_value, time()+3600, "/vulnerabilities/weak_id/", $_SERVER['HTTP_HOST'], true, true);
$domain = ($_SERVER['SERVER_NAME'] != 'localhost') ? $_SERVER['HTTP_HOST'] : false;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why aren't you setting it if it is localhost?

The default according to the manual should be an empty string, not false.

Would it make sense to do an equals check and reverse the two value fields? That would read better to me.

@digininja
Copy link
Owner

I hadn't clicked enough save buttons.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants