sweetsecret
sweetsecret

Reputation: 33

Password remember does not work as needed

On the website I am working on it has been deployed but the problem I am facing is that when I enter a username and password and click on the check box to remember...It remembers the password for sometime.. wen I login in after 5 or 10 minutes it remembers the password but aftr a long period of time like about 2hours it forgets the username and password and i have to type it in all over again... this dint used to happen with the old server as even I could sign in and it remembered the password the next day until i log off... what can be the reason

The session state im using is:

Upvotes: 2

Views: 325

Answers (2)

sweetsecret
sweetsecret

Reputation: 33

Is this setting the cookie expire period??? I am confused

function rememberStyle( cookieName, cookieLife ) {

for( var viewUsed = false, ss = getAllSheets(), x = 0; window.MWJss && MWJss[x] && ss[x]; x++ ) { if( ss[x].disabled != MWJss[x] ) { viewUsed = true; break; } }
if( !window.userHasChosen && !viewUsed ) { return; }
for( var x = 0, outLine = '', doneYet = []; ss[x]; x++ ) {
    if( ss[x].title && ss[x].disabled == false && !doneYet[ss[x].title] ) { doneYet[ss[x].title] = true; outLine += ( outLine ? ' MWJ ' : '' ) + escape( ss[x].title ); } }
if( ss.length ) { document.cookie = escape( cookieName ) + '=' + escape( outLine ) + ( cookieLife ? ';expires=' + new Date( ( new Date() ).getTime() + ( cookieLife * 86400000 ) ).toGMTString() : '' ) + ';path=/'; }

}

Upvotes: 0

rlb.usa
rlb.usa

Reputation: 15043

It sounds like you are facing time-out issues.

That is, you enter the site, and then walk away for some time, and come back, and the site has "forgotten" you, it doesn't know what to do, so it logs you out.

You can fix this by making your Session Timeout longer.

Here's more info and how to do it.

If this is indeed the case, there's nothing wrong with your 'Remember Me" function.

Upvotes: 2

Related Questions