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

The script does not create a new token. Same token at every run. #5

Open
halojoy opened this issue Oct 3, 2019 · 1 comment
Open

Comments

@halojoy
Copy link

halojoy commented Oct 3, 2019

The fix is to put the setToken in echoInputField().
And not in the __construct.

public function echoInputField()
	{
                $this->setToken();
		$token = $this->getToken();
		echo '<input type="hidden" name="'.$this->namespace.'" value="'.$token.'">';
	}
@halojoy
Copy link
Author

halojoy commented Oct 3, 2019

The setToken() should be:

	private function setToken()
	{
        $token = md5(uniqid(rand(), TRUE));
        $_SESSION[$this->namespace] = $token;
	}

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

No branches or pull requests

1 participant