Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to open a url using javascript and set custom HTTP headers to the request?

I want to redirect a user to a url through javascript after they click on a link. Now is there any way to send custom http headers along with this request. I want to send a particular cookie value with the request headers.

The url in question does not belong to my domain.

Is it possible to do it? If yes, how?

like image 414
Sudipta Avatar asked Jul 01 '13 13:07

Sudipta


1 Answers

No.

You can set custom headers if you are using XMLHttpRequest (although it might ban you from setting a Cookie header), but not otherwise (and a redirect is otherwise).

like image 140
Quentin Avatar answered Sep 21 '22 03:09

Quentin