fryette / webview_cookie_manager

MIT License
48 stars 52 forks source link

Forbidden character in cookies #44

Closed Coder13134 closed 3 years ago

Coder13134 commented 3 years ago

Greetings. I logged in to one of the sites using webviews. Now I am trying to get the cookie, but I get the following error. Apparently, the cookies contain a forbidden character (slash). How can this problem be solved? Before that, everything worked. Appeared with a flutter version update (dart)

Screenshot_3 Screenshot_1 Screenshot_2

ertgrulll commented 3 years ago

Same here. image

Coder13134 commented 3 years ago

Same here. image

Hi ertgrulll. I solved the given problem as follows:

fryette commented 3 years ago

I would suggest making a PR. It's really appreciated

ertgrulll commented 3 years ago

Same here. image

Hi ertgrulll. I solved the given problem as follows:

  • Doing fork this module
  • add next string: Screenshot_1
  • and write in pubspec.yaml (instead original string): image

Hi, thanks for solution. It's working when backslash replaced with "". But it will not work on cookies that contains something like "\"", because you are removing all backslashes, removeInvalidCharacter method should change with this:

String removeInvalidCharacter(String value) {
    // Remove Invalid Character
    var valueModified = value.replaceAll('\\"', "'").replaceAll("\\", "");
    valueModified = valueModified.replaceAll(String.fromCharCode(32), "");
    return valueModified;
}
fryette commented 3 years ago

Merged and release new 2.0.1 version. Thanks for your contribution @ertgrulll