Page 1 of 1

How to change http headers from a module

Posted: Fri Jun 22, 2007 10:25 am
by longo
I am creating a simple module that needs to set a cookie on the user's browser. This obviously needs to be done before cmsms starts sending content, so cant be done (elegantly) from a {cms_module ...} tag.

How can I create a hook that gets called early on in cmsms execution? So far the best place I have found is the module callback function TemplatePreCompile(). Is that my best bet, or is there a "better" hook?


Also, how do you make your module respond to certain Events? I have read examples that show how to create custom Events, but not on how to respond to events.

Re: How to change http headers from a module

Posted: Fri Jun 22, 2007 2:25 pm
by calguy1000
I've set cookies in the main code of a module with no problems.  FEU now uses cookies to remember login details, and I do that in the primary code.

also, have you seen the AddEventHandler method in the module api?

Re: How to change http headers from a module

Posted: Sat Jun 23, 2007 7:46 pm
by longo
cheers Calguy. Im just getting started with cmsms and Im loving it already.