Page MenuHomePhabricator

Fix the broken JS getCookie() call, which sets a cookie not recognised by the server
Closed, InvalidPublic1 Estimated Story Points

Related Objects

View Standalone Graph
This task is connected to more than 200 other tasks. Only direct parents and subtasks are shown here. Use View Standalone Graph to show more of the graph.

Event Timeline

Jdforrester-WMF assigned this task to Krenair.
Jdforrester-WMF raised the priority of this task from to High.
Jdforrester-WMF updated the task description. (Show Details)
Jdforrester-WMF set Security to None.
Jdforrester-WMF edited a custom field.
alex@alex-laptop:~/Development/MediaWiki/extensions/VisualEditor (master)$ git grep getCookie
VisualEditor.hooks.php:                 return $req->getCookie(
alex@alex-laptop:~/Development/MediaWiki/extensions/VisualEditor (master)$

That's not JS and it already sets the prefix properly...

Why would a function called getCookie be setting a cookie anyway?

Apparently Krinkle knows what this is about.

	private static function getUserEditor( User $user, WebRequest $req ) {
		if ( $user->isAnon() ) {
			return $req->getCookie(
				'VEE',
				'',
				User::getDefaultOption( 'visualeditor-editor' )
			);

I assumed the second parameter to WebRequest::getCookie() was default value. But it new way of setCookie() - which replaced the prefix parmaeter with an options array containing key prefix, never made it to getCookie() so this is already setting the prefix. Never mind :)