代码点火器中的启动会话[关闭]

starting at the top of the view:

<?php ### CREATE SESSION **
$this->load->library('session'); $this->load->library('encrypt');

$newdata = array(
'session_id'  => random hash,
'ip_address'    => 'string - user IP address',
'user_agent'    => 'string - user agent data',
'last_activity' => timestamp
);

$session_id = $this->session->userdata('session_id');

?>

Getting this error:

Parse error: syntax error, unexpected T_STRING, expecting ')'  on line 5

how do I fix this?

Looking at your new comments, to start a session all you need to do is:

<?php
   //Start session
   $this->load->library('session');

   //Try retriving data:
   $session_id = $this->session->userdata('session_id');
   echo $session_id;