Best practices in session variable names

I'm used to calling my session variables in the “normal” way, sort of like when I want to track user details, I call them:

  • $_SESSION['username']
  • $_SESSION['email']
  • $_SESSION['id']

I am worried that they may conflict with other session data when I browse sites in one browser or there will be no conflicts at all (once I tried to run two of my projects with the same session, variables living on the same server, and obviously everything became useless).

+5
source share
2 answers

. cookie, . , , Cookies .

+11

, :

$_SESSION['myapp']['username']
$_SESSION['myapp']['id']

.

: , . .

+2

All Articles