* marked HttpOnly. The JavaScript code converts the cookie to a wgPostEdit config
* variable.
*
- * We use a path of '/' since wgCookiePath is not exposed to JS
- *
* If the variable were set on the server, it would be cached, which is unwanted
* since the post-edit state should only apply to the load right after the save.
*
$response = RequestContext::getMain()->getRequest()->response();
$response->setcookie( $postEditKey, $val, time() + self::POST_EDIT_COOKIE_DURATION, array(
- 'path' => '/',
'httpOnly' => false,
) );
}
'scripts' => 'resources/src/mediawiki.action/mediawiki.action.view.postEdit.js',
'styles' => 'resources/src/mediawiki.action/mediawiki.action.view.postEdit.css',
'dependencies' => array(
- 'jquery.cookie',
+ 'mediawiki.cookie',
'mediawiki.jqueryMsg'
),
'messages' => array(
* @member mw.hook
*/
- var config = mw.config.get( [ 'wgAction', 'wgCookiePrefix', 'wgCurRevisionId' ] ),
+ var config = mw.config.get( [ 'wgAction', 'wgCurRevisionId' ] ),
// This should match EditPage::POST_EDIT_COOKIE_KEY_PREFIX:
- cookieKey = config.wgCookiePrefix + 'PostEditRevision' + config.wgCurRevisionId,
- cookieVal = $.cookie( cookieKey ),
+ cookieKey = 'PostEditRevision' + config.wgCurRevisionId,
+ cookieVal = mw.cookie.get( cookieKey ),
$div, id;
function showConfirmation( data ) {
mw.user
)
} );
- $.cookie( cookieKey, null, { path: '/' } );
+ mw.cookie.set( cookieKey, null );
}
} ( mediaWiki, jQuery ) );