How to change http headers from a module

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Locked
longo

How to change http headers from a module

Post 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.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: How to change http headers from a module

Post 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?
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
longo

Re: How to change http headers from a module

Post by longo »

cheers Calguy. Im just getting started with cmsms and Im loving it already.
Locked

Return to “Modules/Add-Ons”