|  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: 2021-06-22 12:26 UTC
Avg. Score:4.6 ± 0.8
Reproduced:8 of 8 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: valentiny510 at gmail dot com Assigned: cmb (profile)
Status: Closed 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:
Bug Type:
From: valentiny510 at gmail dot com
New email:
PHP Version: OS:


 [2019-06-15 02:21 UTC] valentiny510 at gmail dot com
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


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2021-06-22 12:26 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2021-06-22 12:26 UTC]
The bug tracker of APCu has been moved to Github[1].  If you're
still interested in this feature, please request it there.

[1] <>
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Tue Aug 03 09:01:23 2021 UTC