Jump to content

Is this "safe" to do with a $_SESSION variable??


cbassett03

Recommended Posts

When storing and retrieving data using sessions in PHP, is it OK to do something like this:

 

$_SESSION['person']['lastname']

 

Or should I just stick to something like:

 

$_SESSION['person_lastName']

 

I personally like the first example better for ease of reading and interpreting, but want to make sure that it can be traversed (using an array) and is "safe" to use (and that won't crash a PHP script).

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.