Results 1 to 2 of 2
Aug 9, 2012, 15:31 #1
- Join Date
- Sep 2004
- Provo, UT
- 1 Post(s)
- 0 Thread(s)
Trying to implement session_name to keep variables from mixing
I have a website and backend tool that both use $_SESSION[firstName] and sometimes the data mixes. So I did some research and came up with session_name, but it's not working for me. The admin session variable is not being shown on the page I created to show session variables. Do I have this setup correctly?
Backend tools page:
$_SESSION['admin'] = "Yes";
header("Cache-control: private"); // IE 6 Fix.
Session variable display page:
echo '</pre>';Convert your dollars into silver coins. www.convert2silver.com
Aug 9, 2012, 19:08 #2
Drop session_name. Just use nested arrays...as so:
$_SESSION = array( 'site' => array(), 'Tool' => array() ); $_SESSION['Tool']['something'] = 'whatever';Logic without the fatal effects.
All code snippets are licensed under WTFPL.