MyBB Community Forums

Full Version: Remember Me not working
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hi all

i have this problem on my forum reported by many members that the remember me option is not working for them...

initially i thought its due to cookie settings and hence tried the sticky thread.... now i have the perfect settings as given in that thread and even regenerated the settings.php..... even asked members to clear the cache/cookies from their browsers..... still no luck

so, a member logs in with the remember me checked and shuts down his computer without logging out of forum. when he turns his computer back on he finds himself logged out.... can anyone locate where the problem is.....

in case you need the forum url, its in my siggy Big Grin
Looks like no one has any solution Huh
Only way I could get 'remember me' (as least the password) to work was to use the 'long-form' login instead the 'short-form' login with edit (comment out) at general.js...

//
		quickLogin: function()
	{	
		// omit quickLogin code below for make longform login standard at forum

		if($("quick_login"))
		{
			var form = new Element("form", { method: "post", action: "member.php" });
			form.insert({ bottom: new Element("input",
				{
					name: "action",
					type: "hidden",
					value: "do_login"
				})
			});

			if(document.location.href)
			{
				form.insert({ bottom: new Element("input",
					{
						name: "url",
						type: "hidden",
						value: this.HTMLchars(document.location.href)
					})
				});
			}

			form.insert({ bottom: new Element ("input",
				{
					name: "quick_login",
					type: "hidden",
					value: "1"
				})
			});

			form.insert({ bottom: new Element("input",
				{
					name: "quick_username",
					id: "quick_login_username",
					type: "text",
					value: lang.username,
					"class": "textbox",
					onfocus: "if(this.value == '"+lang.username+"') { this.value=''; }",
					onblur: "if(this.value == '') { this.value='"+lang.username+"'; }"
				})
			}).insert({ bottom: "Username " });

			form.insert({ bottom: new Element("input",
				{
					name: "quick_password",
					id: "quick_login_password",
					type: "password",
					value: lang.password,
					"class": "textbox",
					onfocus: "if(this.value == '"+lang.password+"') { this.value=''; }",
					onblur: "if(this.value == '') { this.value='"+lang.password+"'; }"
				})
			}).insert({ bottom: "Password " });

			form.insert({ bottom: new Element("input",
				{
					name: "submit",
					type: "submit",
					value: lang.login,
					"class": "button"
				})
			});

			var span = new Element("span", { "class": "remember_me" }).insert({ bottom: new Element("input",
				{
					name: "quick_remember",
					id: "quick_login_remember",
					type: "checkbox",
					value: "yes",
					"class": "checkbox"
				})
			});

			span.innerHTML += "<label for=\"quick_login_remember\"> "+lang.remember_me+"</label>";
			form.insert({ bottom: span });

			form.innerHTML += lang.lost_password+lang.register_url;
	
			$("quick_login").innerHTML = "";
			$("quick_login").insert({ before: form });

			$("quick_login_remember").setAttribute("checked", "checked");
			$('quick_login_username').focus();
		}
		return false;  
// 

And edit 'header_welcomeblock_guest' accordingly...

Quote:<a href="{$mybb->settings['bburl']}/member.php?action=login">
{$lang->welcome_login}</a>

But, it would be nice to have the short-form work... although as you indicated, Huh , it may not be possible ?
Rolleyes