Answer the question
In order to leave comments, you need to log in
How to hide msorder on msGetOrder page?
Hello!
Here's the situation: I'm developing an online store, with modx and minishop on "you". Faced with the fact that after the user clicks on the checkout button, he is redirected to the msGetOrder page (logically), the get parameter "msorder" is passed in the address bar. Because of this, a small vulnerability appears :D maybe. someone can change the id and see what others ordered, and this, something tells me, is wrong)
How can I solve this? Perhaps somehow hide or encode the id? I rummaged through the minishop settings, but found nothing, missed something?
In general, perhaps there are other ways to solve this?
Thank you in advance to everyone, at least for reading my scribble to the end :D
Answer the question
In order to leave comments, you need to log in
I also faced this problem and did not find a solution on the Internet.
I managed to solve the problem with the help of the snippet.
$mainPage = $modx->makeUrl(1);
$resource = $modx->resource;
$orderPage = $modx->makeUrl($resource->get('id')) . $get;
switch ($step) {
case "clear":
setcookie ("myOrder", "");
break;
case "check":
if(!isset($_COOKIE["myOrder"])){
setcookie ("myOrder", $value);
$modx->sendRedirect($orderPage,array('responseCode' => 'HTTP/1.1 301 Moved Permanently'));
}
if($_COOKIE["myOrder"] != $value){
$modx->sendRedirect($mainPage,array('responseCode' => 'HTTP/1.1 301 Moved Permanently'));
}
break;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question