Teaching of a Samurai Engineer 8: Cookies and Sessions, part 2 (Implementation: Cookies)
Last time, we mostly looked at the difference between cookies and sessions (relating to PHP-provided sessions.
This time, let’s go a bit heavy on the code, and learn about things to watch out for during implementation.
First, whether for cookies or sessions, at the end you will output a Cookie (HTTP response header).
Thus, while it depends on your php. ini’s settings (output_buffering), writing code like below can get you an error that reads ‘Warning: session_start (): Cannot start session when headers already sent in’ or ‘Warning: Cannot modify header information — headers already sent by’.
(Please see below for the rest)
リンク
御社のプレスリリース・イベント情報を登録するには、ZDNet Japan企業情報センターサービスへのお申し込みをいただく必要がございます。詳しくは以下のページをご覧ください。