You can define a timeout for stored values. After the given timeout the stored content gets deleted or invalid. Add the following line to our example to find out how this works:
... <save result="output" store=”output” key="welcomePage" presentable="true"/> <save result="output" store=”repository” key="/files/welcomePage.html" presentable="true"/> <save result="output" store=”repository” key="/files/illPage.html" presentable="true" timeout=”30000” /> ...
After uploading these changes, reload the page and have a look at the repository by opening it again in the Webfolder. You will see two pages that have been stored as expected, one with the name welcomePage.html that we already know and a new one with the name illPage.html.
If you reload this Webfolder view after half a minute by either choosing this entry from the menu or pressing F5, you will see that the illPage.html disappeared. As we have defined a timeout of 30000 milliseconds, this is exactly what we wanted.
The timeout is very useful if you are using the cookie store that we have not used right now. If you store content in the cookie store, a cookie is automatically created on the client machine. This cookie will be deleted from the client computer when its time that we have defined using the timeout attribute is up. When using the cookie store the standard cookie technology is used to realize the timeout mechanism, otherwise Projector handles the timeout itself.
We will see the cookie store in action in later examples.