Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I do my own HTTP header attribute?

Tags:

http

jsp

header

can I make my own headers in HTTP request?

e.g. This is normal HTTP request

GET / HTTP/1.1
Host: google.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT x.x; xx; rv:x.x.x.x) xxx        Firefox/3.0.10 (.NET CLR 3.5.30729)
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: xx,en-us;q=0.7,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: windows-1250,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive

and this is header with my "attribute"

GET / HTTP/1.1
Host: google.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT x.x; xx; rv:x.x.x.x) xxx        Firefox/3.0.10 (.NET CLR 3.5.30729)
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: xx,en-us;q=0.7,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: windows-1250,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Name: John

and I will have "attribute" in server response. I'll use "attrubutes" in HTTP headers instead of sessions attributes...

BTW.Sorry for my english... ;)

like image 675
wokena Avatar asked Oct 19 '25 15:10

wokena


1 Answers

Are you trying to reinvent cookies?

You know, cookies are just that. A value that the server sends in a header and that the client will return with every request.

like image 54
wmeyer Avatar answered Oct 22 '25 00:10

wmeyer