-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
how to send a raw cookie? #18661
Comments
What's your use case? |
@samdark |
Why? |
I'm not sure what is the reason behind this questioning. There is an option to send raw cookie available and we are not allowing to use it out of the box. The question is not whether it is better to use |
I've re-read RFC and it seems if you're carefully using ASCII values only you're safe not encoding value. I'd not consider that a good practice though. That's why the question. |
I use this csrf token string, but it will be sended to blowser with
then i must decode it before send it back to backend server with http header |
Alright. So you plan to override AdvantagesNo need to call the following on the client side: function urldecode(url) {
return decodeURIComponent(url.replace(/\+/g, ' '));
} DisadvantagesYou can't avoid |
Looking at the bigger picture here - it doesn't matter what is the reason for OP to have this feature and whether it's good or bad idea for him - I think there should be an option to send it from the framework like in Symfony, and Laravel (not sure here, maybe from v5 it is possible). |
Alright. Let's add "raw" mode. |
yii2/framework/web/Cookie.php
Line 44 in b33f1a7
how about to add a property
sendRaw
, so that we can decide to usesetrawcookie
orsetcookie
in the response?The text was updated successfully, but these errors were encountered: