mafia handling offsite info

I was just wondering if mafia accepts cookies from sites other than KoL.
If not, is there a way to emulate the behavior?

Essentially, I'm looking for a way to make my script access an offsite forum and be able to make posts there.

Ideas?
 

Grotfang

Developer
I'm intrigued as to why this would be something you wanted to do. I believe you are pretty much limited to whatever visit_url( string url ) returns, so cookies are not accessible. You can submit GET requests happily as normal, and also POST requests.

GET requests are obvious. If not, then this isn't the place for a tutorial. PM me if you need help. POST requests also work fine. I've set up an example for you that I'll leave live for a couple of days.

http://www.bristoldebating.com/post.php

Code:
> ash visit_url( "http://www.bristoldebating.com/post.php?t=text" , false );

Code:
> ash visit_url( "http://www.bristoldebating.com/post.php?t=text" , true );

Hopefully that will illustrate the point.
 
I understand GET and POST but I was never really sure on cookies.

Are they normally just lumped in as POST data anytime a user accesses a page from a site? I know that they must be set/unset (from the server) before any html is sent, but I have no idea how/when a user returns the information.

Not that this info would really help me, since I wouldn't be able to actually retrieve the original cookies in mafia's framework.


Anyway, the reason I ask is that I have a bot that runs quite a bit of the clan's infrastructure and a colleague was wondering if we could link it to our offsite forums.

I'm not sure what he'd want to post for, but we can pull data just fine with visit_url() which is all we have for now.
 

matt.chugg

Moderator

Write your own webservice in php or asp(.net) to maintain the session on the 'other' site, and have the afformentioned webservice accept get/post requests from mafia and post them. kind of like a proxy. although theres probably some minor security issues there, if no-one is going to ever have the script you could add some validation to the post so the 'proxy' only accepts data from you.

cookies are set with a set-cookie header in response to a post or get, usually from a login submission (mostly will require post). grab and save the value, and then use it in a cookie header with any further communication.
 
Last edited:
Write your own webservice in php or asp(.net) to maintain the session on the 'other' site, and have the afformentioned webservice accept get/post requests from mafia and post them. kind of like a proxy. although theres probably some minor security issues there, if no-one is going to ever have the script you could add some validation to the post so the 'proxy' only accepts data from you.

cookies are set with a set-cookie header in response to a post or get, usually from a login submission (mostly will require post). grab and save the value, and then use it in a cookie header with any further communication.

That's... so incredibly simple. And versatile. Granted I'd still have to do a bit of learning to get the server to accept cookies (all my work up until now has been in setting and manipulating), that would work out for a bunch of other uses as well (mafiaSQL!) And now I'm even -more- sad that my desktop died (it was all ready to go with LAMP and WAMP [not that I ever booted into linux...]). I'm a broke ho so I can't really afford server space elsewhere than my home... though this may motivate me to get it set up again which would also make running the bot that needs this off-site access easier as well.
 
Top