-
☆ A M B ☆
- 113 Posts
A site of ours has video ads running on the home page. I am using an output modifier snippet to set a unique session variable when a video loads and return true or false to tell the player whether to autoplay or not.
The issue I am having is that it works correctly most of the time but sometimes the session is set without the video ever loading. I clear all the domain and session cookies, load once and it sets a session. Load a second time and it sets two sessions. This seems to always happen immediately after the modx.user.contextTokens session loads.
I am setting individual variables seperately from the modx system. Should I be setting my sessions inside the modx.user.contextTokens session array?
I am hosting on Rackspace cloud sites and they tend to have problems with high traffic sites when using their standard session save path which we changed in .htaccess. Normally the session files are visible in the folder we use but that is not happening with this Revolution site so I don't know if that has something to do with it or not.
Any ideas would be greatly appreciated as I have beaten my head against the wall on this all morning.
-
☆ A M B ☆
- 113 Posts
Figured out the session save path wasn't working due to Revolution's database session handler. I removed it in the settings and the sessions started saving to the file system. Neither session handling method changes the main issue I am having.
I don't think it is a cache issue mixing up multiple user sessions either. The timestamps in the malfunctioning session variable is the same or close to the same as the next value.
Array
(
[qjaprph2e7h7m2te3su6u1doh0t6j2724] => 1318531678 <-- Legitimate
[modx.user.contextTokens] => Array
(
)
[qjaprph2e7h7m2te3su6u1doh0t6j2723] => 1318531680 <-- BAD, content never loaded on page.
[qjaprph2e7h7m2te3su6u1doh0t6j2719] => 1318531681 <-- Legitimate
)
The output modifier that sets the session variable is called in a getResouces snippet tpl so my current theory is getResources is parsing and discarding results without displaying which causes multiple sessions to be added. Guess I'll have to find another way to do this.
[ed. note: pyrographics last edited this post 14 years, 11 months ago.]