I thought about some helper to manage session variables on my development localhost.
I would like to read,change and delete session variables from ALL vhosts on my machine.
As far i know, from PHP i can access only current host session variables, which will be populated to $_SESSION variable, after call to session_start. That's not enough for my needs.
After some research (ex. Access active sessions in PHP) i found solution :
- Load all files from php session directory
- Use session_decode to load data to $_SESSION variable
- Read/change/delete some variables
- Use session_encode to encode my session back to file
There is any better method to do that? Maybe there is already dedicated tool for that task?
EDIT: Another solution which i now currenty use is just enable debugger in IDE for desired project, and use watches/stack window to edit session.
EDIT2: I dont want any project-specific solution like storing session data in database. This should work "out-of-the-box", for any project. For better understanding, use example: In magento admin panel grid filters are stored in session variables. When you enable broken filter there is an error page, and you can't easily disable this filter without removing session cookie, or setting debugger for it.