session_destroy関数

セッション > session_destroy関数

概要

 状態:-  閲覧数:2,259  投稿日:2014-07-09  更新日:2014-07-10  
・セッションを用いるページ群の最後に、全てのセッションデータを破棄する目的で用いる
・セッションの保存に使ったファイルを削除するだけの関数だが、手順を間違えてCookieや$_SESSIONなどのデータが残っているとファイルを削除しない
・サーバ上にゴミファイルが残らないように注意
  セッションデータ(セッションデータを保存するための配列)を空にするか? セッションファイルを削除するか? 実行完了後にはセッションを使うことができるか?
$_SESSION = array() ○ × ○
session_unset() ○ × ○
session_destroy() ○ ○ ×



コメント投稿(ログインが必要)



類似度ページランキング
順位 ページタイトル抜粋 %
1 session_destroy関数 71
2 json_encode関数 53
3 setcookie関数 50
4 session_start() 50
5 syntax error 48
6 Doctrine 48
7 set_error_handler 47
8 Generators 44
9 register_globals 42
10 http_build_query 42
11 register_shutdown_function 42
12 session_set_save_handler() 42
13 整数型(integer) 41
14 include_path 41
15 array_filter 41
16 define と const の違い 40
17 ob_start 40
18 SessionHandler::gc 40
19 session_save_path() 39
20 array_diff 37
2026/11/10 1:20 更新
週間人気ページランキング / 11-2 → 11-8
順位 ページタイトル抜粋 アクセス数
1 PHP用語 13
2 Fatal error: Uncaught exception 'ImagickException' with message 'WriteBlob Failed | エラーメッセージ 5
3 クラスの基本構造 4
3 Parse error: syntax error, unexpected 'new' (T_NEW) | Parse error(エラーメッセージ) 4
4 セッション処理の流れ 3
4 SQLインジェクション | セキュリティ 3
4 static修飾子 | クラスとオブジェクト 3
4 Parse error: syntax error, unexpected 'public' (T_PUBLIC) | Parse error(エラーメッセージ) 3
4 ( ! ) Fatal error: Uncaught PDOException: SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens | Fatal error(エラーメッセージ) 3
5 curl で Cookie を使用する 2
5 言語構造 2
5 ログイン 2
5 セッションデータ | セッション 2
5 Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[28000] [1045] Access denied for user 'データベースユーザー名'@'localhost' (using password: YES)' | phpMyAdmin(データベース関連) 2
5 実際に遭遇した例2 2
5 Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 23 Out of resources when opening file '/tmp/#sql_2dd6_0.MYI' (Errcode: 24)' | エラーメッセージ 2
5 セッションのガベージコレクション (ごみの収集)はなぜ必要なの? 2
5 or(||) | 演算子 2
5 Parse error: syntax error, unexpected T_DOUBLE_ARROW in △△ on line □□ | Parse error(エラーメッセージ) 2
5 デバッグ カテゴリー 2
2026/11/9 5:05 更新