session don't save vars

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
boze
New php-forum User
New php-forum User
Posts: 1
Joined: Thu May 10, 2018 12:31 pm

Fri May 11, 2018 10:57 am

hi ,
i starting session
session_start();

then creating var for example
$_SESSION['uname'] = $_POST['uname'];

but the var not been saved ..

** on local virtual php server its works fine

how can i find the problem ?

element121
php-forum Fan User
php-forum Fan User
Posts: 622
Joined: Sat Jun 06, 2015 11:46 am
Contact:

Fri Jun 01, 2018 8:16 am

Hi,

Where are you looking for it to be saved?
Do you mean just in the session variable?

Code: Select all

$_SESSION['uname'] = $_POST['uname'];

var_dump($_POST['uname']);
var_dump($_SESSION['uname']);
Try var_dumping both out, what do you see?

Post Reply