RE: Please help: session variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

 

After some debugging, found that the session variables are initialized unconditionally and thus got cleared upon any post operation.   It’s fixed and works now.

Sorry for any trouble caused.

 

Thanks and rgds

/ST Wong

 

From: ST Wong (ITSC) <ST@xxxxxxxxxxxxxxxx>
Sent: Tuesday, June 23, 2020 10:49 AM
To: php-general@xxxxxxxxxxxxx
Subject: Please help: session variable

 

Hi all,

 

I'm newbie to PHP and working on migration of some PHP codes written by others to new server.

 

The main PHP script has some session variables defined. However, after displaying a template:

 

$smarty->display('show_form.tpl');

 

all session variables are gone:

- session_status shows session is active

- session_id shows the correct session id

- /var/lib/php/session/sess_xxx file becomes empty after submitting the form in the template.

 

 

The template is a simply form looks like following:

 

<form name=myForm _onSubmit_="return validatePwd()" method="POST" action="" ">

 

 

session_start() is called at the very beginning of the main PHP script.

 

Besides sessions variables, all variable defined are also lost, eg.

 

$b1 = $_SESSION['logined'];

 

We're using PHP 7.2.24 bundled with CentOS8 and using Smarty 2.6.30, though seems not Smarty related issue.

 

Would anyone please help?

 

Thanks a lot.

/ST Wong


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux