Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prevent Classic ASP from encoding special characters in cookies

As a stop-gap, we are using CloudFlare to handle mobile redirection for a number of our much older sites that are still running Classic ASP. In order to bypass mobile redirection for pages which we don't have a mobile version of, CloudFlare requires we set the following cookie:

__cf_mob_redir

The issue here is that Classic ASP is turning that into this:

%5F%5Fcf%5Fmob%5Fredir

Which if we controlled the reading of the cookie wouldn't matter, but we don't, so it's an issue.

My question is: How can I set a cookie value that includes an underscore in classic ASP?

like image 777
S16 Avatar asked Aug 31 '25 06:08

S16


1 Answers

EDIT

This pure ASP only line worked for me.

Response.AddHeader "Set-Cookie", "__cf_mob_redir=__cf_mob_redir; HttpOnly"

Ignore previous answer.

like image 114
Daniele D. Avatar answered Sep 02 '25 21:09

Daniele D.