php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #78171 Add a prefix to Apc/u
Submitted: 2019-06-15 02:21 UTC Modified: -
Votes:6
Avg. Score:4.3 ± 0.9
Reproduced:4 of 4 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: valentiny510 at gmail dot com Assigned:
Status: Open Package: APC (PECL)
PHP Version: Irrelevant OS: Irrelevant
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: valentiny510 at gmail dot com
New email:
PHP Version: OS:

 

 [2019-06-15 02:21 UTC] valentiny510 at gmail dot com
Description:
------------
Apc/u is (obviously) a good and fast way of sharing data between aplications
(as intended), but sometimes you may need NOT to do it, at least not
in the 'normal way'...

I often manage several websites in a dev enviroment, and the 'worst'
thing one could do is to store sensible data like sessions, user data,
etc... (without a Prefix) to avoid extra connections to the database...

apc_store('user_{id}', [session_data => ..., etc => ...])

Then all the dev websites will share the exact same info/data for the user_{id}
Of course I have a wrapper class that prefix everything but I think will be very
very usefull to have it implemented in the core and because C is faster...
A simple function that set the prefix for the session, for instance...

apcu_prefix(string $prefix = null)

And calling the function without argument can return the current prefix
or maybe just reset it to default...

Can also be a very important feature from a security POV since I have seen
some very bad configured shared hosts having this problem, and one could
read the info that other hosts had stored...

The prefix can also act like a password... for functions like apcu_cache_info
Only if you know the prefix/password you will be able to get the info

Thank you


Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sat Jul 20 06:01:26 2019 UTC