RW Themes are Eating my Cookies!

Greetings everyone,

I am playing with creating cookies using PHP. The problem I am encountering is that I need to set the cookie before any other content is loaded onto the page. This presents a challenge with RapidWeaver as the themes load content before the content I put into the page.

Anyone have any ideas how I can get around this other than not using a theme at all?

Cheers,

Brandon

The prefix code area should do what you want.
Page level:

Site wide:

Thanks @teefers! I completely forgot that was there.

Now to work out how I can build a stack that puts content into the prefix. =P

Oh you didn’t say stacks.
I would guess your looking to do the PHP:
session_start();
If that is the case there is an option in the stacks Property List:
http://api.yourhead.com/keys/requiresPhpSession/

1 Like

I’m doing both =P

I start by coding outside of RW, then in a HTML plugin page within RW, then a stack.

Don’t know if I understand what you are saying with

If what you a doing trying to start or resume a session then for the native HTML page(s) and the HTML plugin(s) page you would add this:

<?php session_start(); ?>

Since a start session would need to be the first thing make sure it’s the first line in the native page(s) and use the Prefix for the RW plugin page.

For the stack you could use stacks Property List.

1 Like