Question regarding Sessions

General discussions related to php

Moderators: egami, macek, gesf

Post Reply
User avatar
nugax
New php-forum User
New php-forum User
Posts: 1
Joined: Fri Mar 19, 2021 1:36 pm

Fri Mar 19, 2021 1:38 pm

With php sessions, I am assuming you cannot add an associative array as a session variable?
Is that correct?
-Nugax
iago
php-forum Active User
php-forum Active User
Posts: 41
Joined: Thu Mar 26, 2020 2:33 pm

Fri Mar 19, 2021 2:29 pm

$_SESSION is an associative array, but you can do s.th. like: $_SESSION['foo']['bar']
User avatar
Strider64
php-forum GURU
php-forum GURU
Posts: 418
Joined: Sat Mar 23, 2013 8:24 am
Location: Livonia, MI
Contact:

Sat Mar 20, 2021 2:10 am

nugax wrote:
Fri Mar 19, 2021 1:38 pm
With php sessions, I am assuming you cannot add an associative array as a session variable?
Is that correct?
You can, but that is also leading a person down a slippery slope as it tends to lead them to put everything in sessions. Sensitive data such a passwords should NOT go into sessions. Just my opinion.
Life is a fig newton of your imagination! https://www.miniaturephotographer.com
Post Reply