donlego Posted October 7, 2019 Share Posted October 7, 2019 hello i have url with http://localhost:8077/?role=administrator with parameter role on session timeout or invalid sesion how to make when click restart application the default url back to http://localhost:8077/?role=administrator the parameter value is dinamic Link to comment Share on other sites More sharing options...
zhyhero Posted October 7, 2019 Share Posted October 7, 2019 Sorry, ignore this Link to comment Share on other sites More sharing options...
donlego Posted October 10, 2019 Author Share Posted October 10, 2019 any body have experience with this ? keep the default ur with parameter when click restart application Link to comment Share on other sites More sharing options...
Sherzod Posted October 10, 2019 Share Posted October 10, 2019 51 minutes ago, donlego said: any body have experience with this ? keep the default ur with parameter when click restart application UniMainModule.ServerMessages.TerminateTemplate ? Link to comment Share on other sites More sharing options...
donlego Posted October 10, 2019 Author Share Posted October 10, 2019 The parameter is dinamic Like if i have url Ip_addreess/app/cust_id=100 Ip_addreess/app/cust_id=200 When the session timeout page show, The user click restart app then back to first url Link to comment Share on other sites More sharing options...
Sherzod Posted October 10, 2019 Share Posted October 10, 2019 4 hours ago, donlego said: Ip_addreess/app/cust_id=100 How do you use this link at all? Link to comment Share on other sites More sharing options...
donlego Posted October 11, 2019 Author Share Posted October 11, 2019 9 hours ago, Sherzod said: How do you use this link at all? 211.179.137.233:8077/my_app/?cust_id=1000 211.179.137.233:8077/my_app/?cust_id=2000 Link to comment Share on other sites More sharing options...
donlego Posted December 4, 2019 Author Share Posted December 4, 2019 hello any solution for this ? Link to comment Share on other sites More sharing options...
Sherzod Posted December 4, 2019 Share Posted December 4, 2019 11 minutes ago, donlego said: hello any solution for this ? Sorry, it’s not very clear to me what you are asking. Please make a simple testcase by specifying what should work and how? Link to comment Share on other sites More sharing options...
donlego Posted December 4, 2019 Author Share Posted December 4, 2019 19 minutes ago, Sherzod said: Sorry, it’s not very clear to me what you are asking. Please make a simple testcase by specifying what should work and how? step : 1. on the browser url type localhost:8077/?cust_id=1000 2. try move the form until the session timeout (+-1 second) 3. click the restart application link the url i want back like first 1 opened the url localhost:8077/?cust_id=1000 when user clikc restart application session.rar Link to comment Share on other sites More sharing options...
donlego Posted January 13, 2020 Author Share Posted January 13, 2020 hello any solution for this ? Link to comment Share on other sites More sharing options...
andyhill Posted January 13, 2020 Share Posted January 13, 2020 I have found that StandAlone MOBILE webapps do not honour ServerModule timings so as a work around I catch the MainModule Session TimeOut Event and extend it by 3 minutes (forever). Link to comment Share on other sites More sharing options...
donlego Posted January 13, 2020 Author Share Posted January 13, 2020 17 minutes ago, andyhill said: I have found that StandAlone MOBILE webapps do not honour ServerModule timings so as a work around I catch the MainModule Session TimeOut Event and extend it by 3 minutes (forever). i still need session expire / timeout , my app limiting the user count acces , so if the user session never expire it can be problem to other user who want to login to the app Link to comment Share on other sites More sharing options...
PS1 Posted October 26, 2023 Share Posted October 26, 2023 Hey, any progress in finding the solution ? I need to be able to refresh page after timeout with params : http://localhost:8078/?GUID=6 but it is not always ,,GUID=6" Link to comment Share on other sites More sharing options...
Sherzod Posted October 26, 2023 Share Posted October 26, 2023 Hello, I think you need to use cookies for this. Link to comment Share on other sites More sharing options...
PS1 Posted October 26, 2023 Share Posted October 26, 2023 i found solution. I just add javascript "onclick" in the template : <script> function myFunction() { location.reload(); } </script> ... <a onclick="myFunction()">...</a> Link to comment Share on other sites More sharing options...
irigsoft Posted October 26, 2023 Share Posted October 26, 2023 49 minutes ago, PS1 said: Hey, any progress in finding the solution ? I need to be able to refresh page after timeout with params : http://localhost:8078/?GUID=6 but it is not always ,,GUID=6" Hello, I make solution my own. here is it: I use replace URL when user connect and remove some parameters from URL. You try to use this to replace some params when restart session (or use cookies) UniMainModule.CommandLine := TStringList.Create; UniMainModule.CommandLine.StrictDelimiter := True; for i:= 0 to UniApplication.Parameters.Count - 1 do begin try UniMainModule.CommandLine.Add (UniApplication.Parameters [I]); except end; end; //read full URL newURL := UniSession.ARequest.Referer; newURL := StringReplace (newURL,'&user=' + UniMainModule.CommandLine.Values ['user'],'',[rfReplaceAll]); newURL := StringReplace (newURL,'someotherparams=' + UniMainModule.CommandLine.Values ['someotherparams'],'',[rfReplaceAll]); //clear browser data UniSession.AddJS( // Current URL: UniSession.ARequest.Referer 'const nextURL = ''' + newURL + ''';' + 'const nextTitle = ''' + UniServerModule.Title + ''';' + 'const nextState = { additionalInformation: ''Updated'' };' // This will create a new entry in the browser's history, without reloading + 'window.history.pushState(nextState, nextTitle, nextURL);' // This will replace the current entry in the browser's history, without reloading + 'window.history.replaceState(nextState, nextTitle, nextURL);' ); UniSession.ARequest.Referer := newURL; Try it ! here is my replacement of ServerMessages.ExceptionTemplate, InvalidSessionTemplate, TerminateTemplate urlMessage := '<html>' + '<style>' //first style //+ '.button {' //+ ' border: none;' //+ ' color: white;' //+ ' padding: 16px 32px;' //+ ' text-align: center;' //+ ' text-decoration: none;' //+ ' display: inline-block;' //+ ' font-size: 16px;' //+ ' margin: 4px 2px;' //+ ' transition-duration: 0.4s;' //+ ' cursor: pointer;' //+ ' border-radius: 12px;' //+ ' box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.19);' //+ ' margin: 0;' //+ ' position: absolute;' //+ ' top: 10%;' //+ ' left: 50%;' //+ ' -ms-transform: translate(-50%, -50%);' //+ ' transform: translate(-50%, -50%);' //+ '}' //+ '.button1 {' //+ ' background-color: white;' //+ ' color: black;' ////+ ' border: 2px solid #4CAF50;' //+ '}' //+ '.button1:hover {' //+ ' background-color: #4CAF50;' //+ ' color: white;' //+ '}' //like click //+ '.button1:active {' //+ ' background-color: #3e8e41;' //+ ' box-shadow: 0 5px #666;' //+ ' transform: translateY(4px);' //+ '}' //second style + '.button {' + ' font-size: 16px;' + ' margin: 4px 2px;' //+ ' transition-duration: 0.4s;' + ' text-align: center;' + ' text-decoration: none;' + ' display: inline-block;' + ' padding: 16px 32px;' + ' text-align: center;' + ' position: absolute;' + ' cursor: pointer;' + ' outline: none;' + ' color: #fff;' + ' background-color: #04AA6D;' + ' border: none;' + ' border-radius: 15px;' + ' box-shadow: 0 9px #999;' + ' top: 10%;' + ' left: 43%;' //+ ' -ms-transform: translate(-50%, -50%);' //+ ' transform: translate(-50%, -50%);' + '}' + '.button:hover {background-color: #3e8e41}' + '.button:active {' + ' -webkit-animation:anim-effect-c 2s;'// forwards;' + ' color: red;' // + ' background-color: #3e8e41;' + ' background-color: yellow;' + ' box-shadow: 0 5px #666;' + ' transform: translateY(4px);' + ' }'//:active // + '.button::after {' // + ' -webkit-animation:anim-effect-c 2s forwards;' // + ' background-color: red;' // + ' -webkit-transform:scale3d(0.3,0.3,1);' // + '}'//:after + '@-webkit-keyframes anim-effect-c {' + ' 0% {' + ' opacity:1;' + ' -webkit-transform:scale3d(0.5,0.5,1);' + ' }' + ' 15% {' + ' opacity:1;' + ' -webkit-transform:scale3d(1.5,1.5,1);' + ' }' + ' 30% {' + ' opacity:1;' + ' background-color: red;' + ' color: green;' + ' -webkit-transform:scale3d(2,2,1);' + ' }' + ' 50% {' + ' opacity:0;' + ' background-color: blue;' + ' color: red;' + ' -webkit-transform:scale3d(0.3,0.3,1);' + ' }' + ' 100% {' + ' opacity:0;' + ' background-color: #3e8e41;' + ' -webkit-transform:scale3d(1,1,1);' + ' }' + '}'//@-webkit-keyframes anim-effect-c + '</style>' //reload page + '<script>' + 'function redirect() {' //remove hash from url, else block and have problem + ' var url = window.location.href;' + ' var hash = window.location.hash' + 'endss' + ';' + ' var index_of_hash = url.indexOf(hash) || url.length;' + ' var hashless_url = url.substr(0, index_of_hash);' //+ ' alert (hashless_url);' + ' location.href = hashless_url;' //clear url //+ 'location.href = window.location.href;' //replace hash //+ 'location.href.replace(location.hash,"");' + '}' + '</script>' + '<body bgcolor="#dfe8f6">' + '<p style="text-align:center;color:#0000A0">[###message###]</p>' + '<button class="button button1" type="button" onclick=redirect()>Restart application</button>' + '</body>' + '</html> ServerMessages.ExceptionTemplate.Text := urlMessage; ServerMessages.InvalidSessionTemplate.Text := urlMessage; ServerMessages.TerminateTemplate.Text := urlMessage; 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now