session_start di php

Halo semuanya, mau tanya , ini kenapa bikin login seasson gak bisa muncul ya ? padahal udah ada session_start() , mau munculin $_SESSION ['dataid'] ga bisa

fungsi

index.php

error

Terima Kasih

avatar factorchrist
@factorchrist

3 Kontribusi 2 Poin

Diperbarui 8 tahun yang lalu

3 Jawaban:

Coba check dulu sebelum di echo apakah Session-nya udah ter-set

if (isset($_SESSION['dataid'])){
echo $_SESSION['dataid'];
}

Kalau ga keluar berarti check lagi fungsi login

avatar username
@username

70 Kontribusi 19 Poin

Dipost 8 tahun yang lalu

apakah memakai xampp terbaru gan, (PHP 7 ) coba cari file php.ini di xampp\php set use_only_cookies=1

semoga lancar..

avatar paktani
@paktani

32 Kontribusi 10 Poin

Dipost 8 tahun yang lalu

Ada bug di xampp nya di PHP.INI Ini jawaban dari Bitnami Developer:

" we have been checking the configuration of XAMPP and we found that the issue is related to the use_only_cookies variable that you can find in the Session's section of the php.ini file. Apache will crash if the use_only_cookies variable in the Session's section is set to 0 and everything is fine if it's set to 1.

http://php.net/manual/en/session.configuration.php#ini.session.use-only-cookies

We also checked that the use_strict_mode should be set to 1.

https://wiki.php.net/rfc/strict_sessions http://php.net/manual/en/session.configuration.php#ini.session.use-strict-mode

We'll include those changes in the next version of XAMPP with PHP 7. We are building the installers with the version 7.0.2 and we'll release them as soon as possible. "

avatar paktani
@paktani

32 Kontribusi 10 Poin

Dipost 8 tahun yang lalu

Login untuk ikut Jawaban