adrian-d of Rouge Devs
11/3/2016 - 12:07 PM

Solving the cached 'empty login box' issue on a deployed site without SSH available

Solving the cached 'empty login box' issue on a deployed site without SSH available

The only requirement here is to use Google Chrome.

1. Get both sites up, in different browsers. One will have a full login form, the other won't.

2. Inspect the <form> element for the login form, in each browser. Right click this element and select 'Edit as HTML'.

3. Paste each form element into separate text editor windows. As a sample, they will generally look like the below.

Broken form:
<form action="/user/login" method="post" id="user-login" accept-charset="UTF-8">
	<div>
		<input type="hidden" name="form_build_id" value="[BUILD ID CODE]"> <input type="hidden" name="form_id" value="user_login">
	</div>
</form>

Working form:
<form action="/user" method="post" id="user-login" accept-charset="UTF-8">
	<div>
		<div class="form-type-textfield form-item-name form-item form-group" data-toggle="tooltip" title="" data-original-title="Enter your Landmark Solutions username.">
			<label for="edit-name">Username <span class="form-required" title="This field is required.">*</span></label> <input class="form-control form-text required" type="text" id="edit-name" name="name" value="" size="60" maxlength="60">
		</div>
		<div class="form-type-password form-item-pass form-item form-group" data-toggle="tooltip" title="" data-original-title="Enter the password that accompanies your username.">
			<label for="edit-pass">Password <span class="form-required" title="This field is required.">*</span></label> <input class="form-control form-text required" type="password" id="edit-pass" name="pass" size="60" maxlength="128">
		</div><input type="hidden" name="form_build_id" value="[BUILD ID CODE]"> <input type="hidden" name="form_id" value="user_login"> <button class="btn btn-default form-submit" id="edit-submit" name="op" value="Log in" type="submit">Log in</button>
	</div>
</form>

4. Copy the 'form_build_id' value in the broken form, into the equivalent field in the working version. Copy all of this to your clipboard.

5. Click 'Edit as HTML' on the form element on your broken page, and paste your clipboards' contents into there. Press CTRL+Enter.

6. Fill out the form and submit the page. You will now be logged in, and can clear the website cache through the admin UI.