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.
How to change http headers from a module
-
- 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
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?
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.
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.
Re: How to change http headers from a module
cheers Calguy. Im just getting started with cmsms and Im loving it already.