News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Will removing "stay logged in for" cause problems?

Started by tophe, March 14, 2005, 07:08:49 PM

Previous topic - Next topic

tophe

I removed the dropdown in the login module where you may choose for how long
to stay logged in. Will this cause any greater problems for my users?

Orstio

Did you assign a hidden input value in its place?

It is important to setting the cookie length.  The variable the dropdown menu sets must be assigned and inputted by the form, if even by hidden input.

tophe

#2
Probably it would be best to set it to "forever".. Since most people never touch that menu.

Here's the original code:

echo '
', $txt['welcome_guest'], '<br />
', $context['current_time'], '<br />

<form action="', $scripturl, '?action=mambo_login" method="post" style="margin: 3px 1ex 1px 0; text-align:'.$smf_align.';">
Username:<input type="text" name="user" size="10" /><br />
Password:<input type="password" name="passwrd" size="10" />
<br />[b]Stay logged in for: <select name="cookielength">
<option value="60">', $txt['smf53'], '</option>
<option value="1440">', $txt['smf47'], '</option>
<option value="10080">', $txt['smf48'], '</option>
<option value="302400">', $txt['smf49'], '</option>
<option value="-1" selected="selected">', $txt['smf50'], '</option>
</select>[/b]
<input type="submit" value="', $txt[34], '" /><br />
<input type="hidden" name="op2" value="login" />
<input type="hidden" name="returnurl" value="', $params->get('login'),'" />
<input type="hidden" name="lang" value="',$mosConfig_lang,'" />
<input type="hidden" name="return" value="',$mosConfig_live_site,'/',basename($_SERVER['PHP_SELF']),'?',$_SERVER['QUERY_STRING'],'" />
<input type="hidden" name="message" value="',$message_login,'" />
......


And here's the modified code:

echo '
', $txt['welcome_guest'], '<br />
', $context['current_time'], '<br />

<form action="', $scripturl, '?action=mambo_login" method="post" style="margin: 3px 1ex 1px 0; text-align:'.$smf_align.';">
Användare:<br /><input type="text" name="user" size="10" /><br />
Lösenord:<br /><input type="password" name="passwrd" size="10" /><br />
                            <input type="submit" value="', $txt[34], '" />
  <br /><input type="hidden" name="op2" value="login" />
<input type="hidden" name="returnurl" value="', $params->get('login'),'" />
<input type="hidden" name="lang" value="',$mosConfig_lang,'" />
<input type="hidden" name="return" value="',$mosConfig_live_site,'/',basename($_SERVER['PHP_SELF']),'?',$_SERVER['QUERY_STRING'],'" />
<input type="hidden" name="message" value="',$message_login,'" />


what value do I need to put in? And where..
I guess I should put -1 somewhere...

Kindred

<input type="hidden" name="cookielength" value="-1">
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: