「Cookieless Sessions」の版間の差分

提供:MoodleDocs
移動先:案内検索
編集の要約なし
編集の要約なし
1行目: 1行目:
{{Moodle 1.6}}
{{Moodle 1.6}}
Moodle 1.6 では Moodle の cookieless sessions サポートを追加しました。 The code will need testing in the different modules to check that it works in all areas of a site. ブラウザで Cookie を無効にするか、あなたの Moodle サイトで Cookie を無効にすることでテストが出来ます。 何かしらバグがあればこちらへ : http://tracker.moodle.org/browse/MDL-4504
Moodle 1.6への我々のMoodleにcookielessセッションのサポートを追加しました。このコードは、サイトのすべての分野で作品を確認するために別々のモジュールのテストが必要になります。お使いのブラウザでクッキーをオフにするかCookieを禁止あなたのMoodleサイトのためだけにしてテストすることができます。ポストすべてのバグをここで見つける : http://tracker.moodle.org/browse/MDL-4504


Cookieless sessions work by appending a session id to every url or to hidden form fields in forms in html pages so that php can track sessions. When cookieless sessions are turned on then code in lib/cookieless.php will automatically add session ids in the absence of cookies. ''The code will fail when javascript is used to jump from page to page.'' So when using javascript to jump to a new page then you can call a function in lib/cookieless.php to add session ids to the URL, as follows :
またはhtmlページのフォームの中に隠しフォームフィールドにこれが、phpセッションを追跡することができますセッションのすべてのURLにIDを付加することによってCookieなしのセッションで動作します。時cookielessセッションをして上のlibのコードになっている/ cookieless.phpは自動的にクッキーがない場合に、セッションIDを追加します。コードは、JavaScriptのページからページへジャンプするために使用すると失敗します。ですから、新しいページをへジャンプする場合はlibの関数を呼び出すことができます/ cookieless.php URLにセッションIDを追加するには、次のようにjavascriptを利用:


     if (!empty($CFG->usesid) && !isset($_COOKIE[session_name()])) {
     if (!empty($CFG->usesid) && !isset($_COOKIE[session_name()])) {

2009年10月9日 (金) 16:47時点における版

Moodle 1.6


Moodle 1.6への我々のMoodleにcookielessセッションのサポートを追加しました。このコードは、サイトのすべての分野で作品を確認するために別々のモジュールのテストが必要になります。お使いのブラウザでクッキーをオフにするかCookieを禁止あなたのMoodleサイトのためだけにしてテストすることができます。ポストすべてのバグをここで見つける : http://tracker.moodle.org/browse/MDL-4504

またはhtmlページのフォームの中に隠しフォームフィールドにこれが、phpセッションを追跡することができますセッションのすべてのURLにIDを付加することによってCookieなしのセッションで動作します。時cookielessセッションをして上のlibのコードになっている/ cookieless.phpは自動的にクッキーがない場合に、セッションIDを追加します。コードは、JavaScriptのページからページへジャンプするために使用すると失敗します。ですから、新しいページをへジャンプする場合はlibの関数を呼び出すことができます/ cookieless.php URLにセッションIDを追加するには、次のようにjavascriptを利用:

   if (!empty($CFG->usesid) && !isset($_COOKIE[session_name()])) {
       $attempturl=sid_process_url("attempt.php?id=$cm->id");
   } else {
       $attempturl="attempt.php?id=$cm->id";
   };

You don't need to include cookieless.php it will have been included already if needed.


Enable cookieless sessions by including $CFG->usesid=true; in config.php. Based on code from php manual by Richard at postamble.co.uk

Attempts to use cookies if cookies not present then uses session ids attached to all urls and forms to pass session id from page to page. If site is open to google, google is given guest access as usual and there are no sessions. No session ids will be attached to urls for googlebot. This doesn't require trans_sid to be turned on but this is recommended for better performance you should put session.use_trans_sid = 1 in your php.ini file and make sure that you don't have a line like this in your php.ini: session.use_only_cookies = 1

author Richard at postamble.co.uk and Jamie Pratt license http://www.gnu.org/copyleft/gpl.html GNU Public License