PDA

View Full Version : How to manage "Remember me" and Sessions



utkarshk.leeway
22 Dec 2011, 5:51 AM
Hi team,

I have made an application in EXTJS using PHP. when i leave my application for sometime stale in no activity mode/ sever sessions are gone, and any of the store can not fetch any data from any webservice. it returns null and thus the UI do not get filled by data at all.

at this point i want user to be redirected to login page and login again and to show him such an alert stating the same.

please let me know how can i do that using extjs.


Regards
UT

tvanzoelen
22 Dec 2011, 7:42 AM
catch the response in a callback, display a message and post a form. Thats the way I do it.

For example;



callback: function(param1, param2, param3){ //params depends on the callback you use

Ext.Msg.confirm(connectionErrorHdr, connectionErrorMsg, //some vars with stringmessages for title and body

function(btn) {

if (btn == 'yes') {
//do nothing
}

if (btn == 'no') {
document.form_screen.submit();
}

}
);
}



but there are probably more elegant ways to do it