前提・実現したいこと
ini
1 2[Session] 3; Handler used to store/retrieve data. 4session.save_handler = files 5 6; Argument passed to save_handler. In the case of files, this is the path 7; where data files are stored. Note: Windows users have to change this 8; variable in order to use PHP's session functions. 9; 10; As of PHP 4.0.1, you can define the path as: 11; 12; session.save_path = "N;/path" 13; 14; where N is an integer. Instead of storing all the session files in 15; /path, what this will do is use subdirectories N-levels deep, and 16; store the session data in those directories. This is useful if you 17; or your OS have problems with lots of files in one directory, and is 18; a more efficient layout for servers that handle lots of sessions. 19; 20; NOTE 1: PHP will not create this directory structure automatically. 21; You can use the script in the ext/session dir for that purpose. 22; NOTE 2: See the section on garbage collection below if you choose to 23; use subdirectories for session storage 24; 25; The file storage module creates files using mode 600 by default. 26; You can change that by using 27; 28; session.save_path = "N;MODE;/path" 29; 30; where MODE is the octal representation of the mode. Note that this 31; does not overwrite the process's umask. 32;session.save_path = "/tmp" 33 34; Whether to use cookies. 35session.use_cookies = 1 36 37;session.cookie_secure = 38 39; This option enables administrators to make their users invulnerable to 40; attacks which involve passing session ids in URLs; defaults to 0. 41; session.use_only_cookies = 1 42 43; Name of the session (used as cookie name). 44session.name = PHPSESSID 45 46; Initialize session on request startup. 47session.auto_start = 1 48 49; Lifetime in seconds of cookie or, if 0, until browser is restarted. 50session.cookie_lifetime = 0 51 52; The path for which the cookie is valid. 53session.cookie_path = / 54 55; The domain for which the cookie is valid. 56session.cookie_domain = 57 58; Whether or not to add the httpOnly flag to the cookie, which makes it inaccessible to browser scripting languages such as JavaScript. 59session.cookie_httponly = 60 61; Handler used to serialize data. php is the standard serializer of PHP. 62session.serialize_handler = php 63 64; Define the probability that the 'garbage collection' process is started 65; on every session initialization. 66; The probability is calculated by using gc_probability/gc_divisor, 67; e.g. 1/100 means there is a 1% chance that the GC process starts 68; on each request. 69 70session.gc_probability = 1 71session.gc_divisor = 1000 72 73; After this number of seconds, stored data will be seen as 'garbage' and 74; cleaned up by the garbage collection process. 75session.gc_maxlifetime = 1440 76 77; NOTE: If you are using the subdirectory option for storing session files 78; (see session.save_path above), then garbage collection does *not* 79; happen automatically. You will need to do your own garbage 80; collection through a shell script, cron entry, or some other method. 81; For example, the following script would is the equivalent of 82; setting session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes): 83; cd /path/to/sessions; find -cmin +24 | xargs rm 84 85; PHP 4.2 and less have an undocumented feature/bug that allows you to 86; to initialize a session variable in the global scope, albeit register_globals 87; is disabled. PHP 4.3 and later will warn you, if this feature is used. 88; You can disable the feature and the warning separately. At this time, 89; the warning is only displayed, if bug_compat_42 is enabled. 90 91session.bug_compat_42 = 0 92session.bug_compat_warn = 1 93 94; Check HTTP Referer to invalidate externally stored URLs containing ids. 95; HTTP_REFERER has to contain this substring for the session to be 96; considered as valid. 97session.referer_check = 98 99; How many bytes to read from the file. 100session.entropy_length = 0 101 102; Specified here to create the session id. 103session.entropy_file = 104 105;session.entropy_length = 16 106 107;session.entropy_file = /dev/urandom 108 109; Set to {nocache,private,public,} to determine HTTP caching aspects 110; or leave this empty to avoid sending anti-caching headers. 111session.cache_limiter = nocache 112 113; Document expires after n minutes. 114session.cache_expire = 180 115 116; trans sid support is disabled by default. 117; Use of trans sid may risk your users security. 118; Use this option with caution. 119; - User may send URL contains active session ID 120; to other person via. email/irc/etc. 121; - URL that contains active session ID may be stored 122; in publically accessible computer. 123; - User may access your site with the same session ID 124; always using URL stored in browser's history or bookmarks. 125session.use_trans_sid = 0 126 127; Select a hash function 128; 0: MD5 (128 bits) 129; 1: SHA-1 (160 bits) 130session.hash_function = 0 131 132; Define how many bits are stored in each character when converting 133; the binary hash data to something readable. 134; 135; 4 bits: 0-9, a-f 136; 5 bits: 0-9, a-v 137; 6 bits: 0-9, a-z, A-Z, "-", "," 138session.hash_bits_per_character = 5 139 140; The URL rewriter will look for URLs in a defined set of HTML tags. 141; form/fieldset are special; if you include them here, the rewriter will 142; add a hidden <input> field with the info which is otherwise appended 143; to URLs. If you want XHTML conformity, remove the form entry. 144; Note that all valid entries require a "=", even if no value follows. 145url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry" 146session.save_path="C:\MAMP\bin\php\sessions\" 147 148
試したこと
上記のコーディング
補足情報(FW/ツールのバージョンなど)
MAMP PHP 7.4.1
ここにより詳細な情報を記載してください。
コードやエラーはマークダウンのcode機能を利用してご提示ください。
https://teratail.com/questions/238564
「ファイル毎」にブロック化してください
すみません。
ソースよりもiniに問題がありそうなのでphpinfoを晒してごらんなさい
すみません。文字数制限に引っ掛かかり、iniファイルの投稿ができませんでした。
じゃあiniが怪しいって言うのがヒントだと思って、iniを起点に自分で調査してみてください。ノーヒントから調べるより楽でしょう。
予想が外れてたら失礼。
ありがとうございます!
挑戦してみます!
すみません。ちょっと自分には難しかったです...
SESSIONの記述箇所を張りましたのでご助力いただければ幸いです。
> すみません。ちょっと自分には難しかったです...
具体的に何を調べたのかが分かりません。
iniが怪しいのにphpinfoを載せろって言ったのは、webサーバー通った後のphpの設定が見たい為です。phpinfo(をwebで表示した結果)を貼ってください。※もちろん、ini以外では絶対に何も変更して無い&把握していない個所で変更されてしまっている可能性も100%無いと言い切れるのならiniでも構いませんが