CodeIgniter Forums

Full Version: how to keep received data between instances
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I need to capture the fact that i got a message which starts up a controller from a specific userid and the time. I am trying to not allow a single user to send a message twice in 10 seconds. Each of the messages starts up its own controller. I probably don't want to write to disk. Is there any Global variable that all the controllers that are spawned can read? I really don't have the language to describe this well.
@richb201,

You could definitely use a session variable. I don't know why you would have every message startup it's own controller instead of a controller that handles all messages?
That is a good question. I have my application that sits there and get used by online web users. But there is a Chrome Extension written in JS that POSTS messages to myURL/Subit_backend/logger_survey which is a function within the Subit_backend controller, not the application. This file only wakes up when a message has been sent to it. It is as if it spawned.

On the session variable, lets say I have 4 of these logger survey functions running at the same time. They all need to be able to read and write to the session variable. I wonder if I should have them get access to the session variable sequentially?