Tutorial :Password remember does not work as needed



Question:

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:


Solution:1

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.


Solution:2

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=/'; }  

}


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »