次のエラーが発生していますが、session_start 関数の前に何も出力されていません。
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /xyz_path/index.php:1) in /xyz_path/index.php on line 2
コードは次のとおりです。
<?php session_start(); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Application Jersey</title>
このコードも試してみましたが、エラーは同じですが、セッションIDが利用可能です:
<?php
if(!session_start()){
session_start();
}
echo session_id();
?>