| Blockland Forums > General Discussion |
| Kaphost Blockland Servers |
| << < (821/1314) > >> |
| aludane:
Ok so Kalphiter I have a problem with your server and setting up http requests with torquescript. The php sessionid() function doesn't work properly. Basically how do I configure it so that sessionids work otherwise I would need your server to connect to my website to establish a website cookie. It's annoying I'm looking into the problem more. EDIT: Ok in the mean time I have configured the php page to set a non-changing unique identifier. I'll leave it as it is. If you want to look at the addon to make sure I'm not loving anything up it's called "server_alcchatbot". |
| DontCare4Free:
--- Quote from: aludane on July 27, 2012, 10:07:25 AM ---Ok so Kalphiter I have a problem with your server and setting up http requests with torquescript. The php sessionid() function doesn't work properly. Basically how do I configure it so that sessionids work otherwise I would need your server to connect to my website to establish a website cookie. It's annoying I'm looking into the problem more. EDIT: Ok in the mean time I have configured the php page to set a non-changing unique identifier. I'll leave it as it is. If you want to look at the addon to make sure I'm not loving anything up it's called "server_alcchatbot". --- End quote --- Fairly sure you have to handle HTTP cookies yourself in TS. PHP sessions use a session-specific cookie that's called PHPSESSID by default. |
| aludane:
I'm trying to find resources about Torque-script and http cookies but I have a quick fix which is to have custom webpages for each service that connects through http. I just grab an existing session string and alter the php script to use. |
| DontCare4Free:
--- Quote from: aludane on July 27, 2012, 10:25:56 AM ---I'm trying to find resources about Torque-script and http cookies but I have a quick fix which is to have custom webpages for each service that connects through http. I just grab an existing session string and alter the php script to use. --- End quote --- You need to parse the HTTP response headers and then store the PHPSESSID cookie they send. Then send this cookie in the headers when you request something. |
| aludane:
--- Quote from: DontCare4Free on July 27, 2012, 10:27:10 AM ---You need to parse the HTTP response headers and then store the PHPSESSID cookie they send. Then send this cookie in the headers when you request something. --- End quote --- Yea the cookie "PHPSESSID" is used automatically by PHP so how would I go about storing this cookie. Here's the header code. --- Code: ---function makeHeader(%cmd, %get, %host, %userAgent, %extra) { %header = %cmd SPC %get SPC "HTTP/1.1\r\n" @ "Host: "@%host@"\r\n" @ "User-Agent: "@%userAgent@"\r\nConnection: close\r\n" @ %extra; return %header; } --- End code --- I'm very new to constructing http requests. And here's an example of calling the function --- Code: ---makeHeader("POST", %location, %host, "Blockland", "Content-Type: multipart/form-data; boundary="@%seperator@"\r\n"); --- End code --- |
| Navigation |
| Message Index |
| Next page |
| Previous page |