-7

I have a PHP code like this to create session:

Session::toast('sessionname', 'sessionvalue');

and than for calling session like this:

if (Session::tersedia('sessionname')) { 
  echo "<div class='notif-merah animNotif'>"
    .Session::toast('sessionname')
    ."</div>"; 
} 

How to create session with JavaScript?

Karol Selak
  • 4,248
  • 6
  • 35
  • 65

1 Answers1

1

The client side are usually scripts that run on the browser, like JavaScript. You should not store sensitive data on the client side. Instead, store sensitive session data on the server by using PHP's associative array $_SESSION. PHP and the browser will take care of handling sessions for you, normally by using cookies.

Lars Gyrup Brink Nielsen
  • 3,939
  • 2
  • 34
  • 35
otu bright
  • 26
  • 1
  • 2