Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to encode? response.cookie with asp classic - vbscript?

Im trying to set a cookie with the value /sv/en and the / ends up like %2F in the cookie, so I wonder how to encode or whatever you have to do to write a / instead.

Im using this to set the cookie now.

 Response.Cookies("googtrans")="/sv/en"
 Response.Cookies("googtrans").path = "/"
 Response.Cookies("googtrans").expires = "2038-01-01 10:00"
 Response.Cookies("googtrans").domain = ".mypage.se"

So how can I write a / in the cookie? Thanks a lot!

like image 985
Claes Gustavsson Avatar asked Dec 11 '25 02:12

Claes Gustavsson


1 Answers

Through the Response.Cookies collection URL Encoding (and vice versa URL Decoding) is implicit.

To prevent this, you need to set a raw cookie with Response.AddHeader instead.

Response.AddHeader "Set-Cookie", "googtrans=/sv/en; expires=2038-01-01 10:00; domain=.mypage.se; path=/"
like image 51
Kul-Tigin Avatar answered Dec 13 '25 23:12

Kul-Tigin