Kodi Community Forum
Possible to use cookie for path, for e.g. setThumbnailImage? - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26)
+--- Thread: Possible to use cookie for path, for e.g. setThumbnailImage? (/showthread.php?tid=183844)



Possible to use cookie for path, for e.g. setThumbnailImage? - munale874 - 2014-01-19

Hi!

Im wondring if its posible to add cookies to the url path to for e.g. setThumbnailImage? I need it for authentication.

Best regards


RE: Possible to use cookie for path, for e.g. setThumbnailImage? - Bstrdsmkr - 2014-01-19

Yes, add a pipe character after the url to specify headers:
Code:
http://www.example.com/foo.jpg|referer=xbmc.org&cookie=ladjkfhauhflen0287346ohui

Remember to urlencode all of the parameter values


RE: Possible to use cookie for path, for e.g. setThumbnailImage? - munale874 - 2014-01-19

(2014-01-19, 19:57)Bstrdsmkr Wrote: Yes, add a pipe character after the url to specify headers:
Code:
http://www.example.com/foo.jpg|referer=xbmc.org&cookie=ladjkfhauhflen0287346ohui

Remember to urlencode all of the parameter values

Thanks, Is the example below correct, or do i need referer?

Code:
http://www.example.com/foo.jpg|cookie=cname=cdata


Best regards


RE: Possible to use cookie for path, for e.g. setThumbnailImage? - Bstrdsmkr - 2014-01-19

The whole value from = to = will be set to the associated header. Since your value contains =, you'll need to escape it by urlencoding the parameter. %3D is the urlencoded equivalent of =, so you'll want something like this:

Code:
http://www.example.com/foo.jpg|cookie=cname%3Dcdata



RE: Possible to use cookie for path, for e.g. setThumbnailImage? - munale874 - 2014-01-19

(2014-01-19, 20:19)Bstrdsmkr Wrote: The whole value from = to = will be set to the associated header. Since your value contains =, you'll need to escape it by urlencoding the parameter. %3D is the urlencoded equivalent of =, so you'll want something like this:

Code:
http://www.example.com/foo.jpg|cookie=cname%3Dcdata

Thank you Bstrdsmkr, I got it now.