Hi ,
We are using VLF version 13(VL Rich Client). We have embedded a new independent application by configuring its url name in the properties tab of a business object. Now the question is how do i delete cookie when clicking SIGN OUT button. Is there a way to achieve this. Please see to the attached screen shot.
How to delete cookie by clicking Sign Out button in VLF Version 13.
-
JABIVULLAS
- Posts: 12
- Joined: Tue Sep 19, 2017 6:07 pm
-
JABIVULLAS
- Posts: 12
- Joined: Tue Sep 19, 2017 6:07 pm
Re: How to delete cookie by clicking Sign Out button in VLF Version 13.
Please refer to the attached screen shot.
- Attachments
-
- sign_out_vlf13.JPG (67.96 KiB) Viewed 42271 times
Re: How to delete cookie by clicking Sign Out button in VLF Version 13.
#1 What is the actual url?
#2 You are going to have to send a signal to the web page and then probably run some javascript to delete the cookies. Sending a signal to the web page will not be that simple....if you are using VL Web you can use local storage to monitor for the message on the other side (the currently opened website) and then on change from the other side you can delete the cookie. I have a mental picture in my mind how this would work. There are some examples of signalling in the shipped examples I think using local storage to communicate between 2 browser windows. You would want to run a seperate url when you click sign out, then that window would signal the other opened browser window in a sideways manner. It could all be done inside LANSA if this is VL Web urls. If not, you would have to write some javascript to do this.
#3 There is the IE activeX control, but I don't think you want to go down the road...it is pretty complicated. When you use the web control from within VL Windows, you are actually running the IE browser control.
Lets get some more details on the url and what kind of application you are running. For instance, is it a LANSA web url or not.
There might be some other ways, this is what I can think of at the moment...
Paul
#2 You are going to have to send a signal to the web page and then probably run some javascript to delete the cookies. Sending a signal to the web page will not be that simple....if you are using VL Web you can use local storage to monitor for the message on the other side (the currently opened website) and then on change from the other side you can delete the cookie. I have a mental picture in my mind how this would work. There are some examples of signalling in the shipped examples I think using local storage to communicate between 2 browser windows. You would want to run a seperate url when you click sign out, then that window would signal the other opened browser window in a sideways manner. It could all be done inside LANSA if this is VL Web urls. If not, you would have to write some javascript to do this.
#3 There is the IE activeX control, but I don't think you want to go down the road...it is pretty complicated. When you use the web control from within VL Windows, you are actually running the IE browser control.
Lets get some more details on the url and what kind of application you are running. For instance, is it a LANSA web url or not.
There might be some other ways, this is what I can think of at the moment...
Paul
-
JABIVULLAS
- Posts: 12
- Joined: Tue Sep 19, 2017 6:07 pm
Re: How to delete cookie by clicking Sign Out button in VLF Version 13.
Hi,
Thanks for your reply. Below is our Web url
http://10.110.4.100:41/images/irfs/LSSA ... G_BASE.HTM.
After we login there is a sign out button on the top right corner. We have embedded two independent applications in our LANSA vlf (ver 13) and wanted to delete cookies that are set for those applications while clicking SIGN OUT button. Please refer to the attached screen shot(encircled sign out button in red).
Please advise how to delete cookies when sign out button is clicked. Appreciate your prompt reply.
Thanks for your reply. Below is our Web url
http://10.110.4.100:41/images/irfs/LSSA ... G_BASE.HTM.
After we login there is a sign out button on the top right corner. We have embedded two independent applications in our LANSA vlf (ver 13) and wanted to delete cookies that are set for those applications while clicking SIGN OUT button. Please refer to the attached screen shot(encircled sign out button in red).
Please advise how to delete cookies when sign out button is clicked. Appreciate your prompt reply.
- Attachments
-
- LD_Web_Signout.png (566.48 KiB) Viewed 42247 times
-
JABIVULLAS
- Posts: 12
- Joined: Tue Sep 19, 2017 6:07 pm
Re: How to delete cookie by clicking Sign Out button in VLF Version 13.
Hi Mark,
Thanks for your reply.
Is this related - https://developer.mozilla.org/en-US/doc ... -Site-Data
Above is your reply. Please let us know where we need to incorporate this piece of code i mean which file or what location.
Thanks for your reply.
Is this related - https://developer.mozilla.org/en-US/doc ... -Site-Data
Above is your reply. Please let us know where we need to incorporate this piece of code i mean which file or what location.
Re: How to delete cookie by clicking Sign Out button in VLF Version 13.
#1 It appears the VLF Win part is not relevant from what I can tell...the screen shot shows a web browser running stand alone. Even if it is inside the Win VLF container (VLF inside VLF) which you don't show, that might just be confusing the issue. What you are showing is just a VLF Web with and exit button.
#2 You are going to need to write a widget. The widget will need single method called mDeleteCookies. You can look at some of the sample widgets to get an idea how to do that...it is not that complicated. You will need to find someone with at least SOME javascript skills.
#3 The widget JavaScript code will need to do something like this.
function getCookie(NameOfCookie)
{
if (document.cookie.length > 0)
{
begin = document.cookie.indexOf(NameOfCookie+"=");
if (begin != -1)
{
begin += NameOfCookie.length+1;
end = document.cookie.indexOf(";", begin);
if (end == -1) end = document.cookie.length;
return unescape(document.cookie.substring(begin, end));
}
}
return null;
}
function setCookie(NameOfCookie, value, expiredays)
{
var ExpireDate = new Date ();
ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 * 1000));
document.cookie = NameOfCookie + "=" + escape(value) +
((expiredays == null) ? "" : "; expires=" + ExpireDate.toGMTString());
}
function delCookie (NameOfCookie)
{
if (getCookie(NameOfCookie)) {
document.cookie = NameOfCookie + "=" +
"; expires=Thu, 01-Jan-70 00:00:01 GMT";
}
}
#4 I would suggest you drop outside of your application, write a simple web page which sets and deletes cookies until you have that working using your new widget. Once you have that, then post the code here - GIVE BACK TO THE COMMUNITY.
#5 Once you have the cookie part you need to add some code to the VLF to capture the sign out event...there is something in the FrameWork I think to capture when you try to leave and do a confirm or something...that is where you would put this remove cookie code.
#6 This is not the greatest code in the world, there might be easier code somewhere....do some googling for the JavaScript stuff and you will find many examples
Good Luck.
Paul
#2 You are going to need to write a widget. The widget will need single method called mDeleteCookies. You can look at some of the sample widgets to get an idea how to do that...it is not that complicated. You will need to find someone with at least SOME javascript skills.
#3 The widget JavaScript code will need to do something like this.
function getCookie(NameOfCookie)
{
if (document.cookie.length > 0)
{
begin = document.cookie.indexOf(NameOfCookie+"=");
if (begin != -1)
{
begin += NameOfCookie.length+1;
end = document.cookie.indexOf(";", begin);
if (end == -1) end = document.cookie.length;
return unescape(document.cookie.substring(begin, end));
}
}
return null;
}
function setCookie(NameOfCookie, value, expiredays)
{
var ExpireDate = new Date ();
ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 * 1000));
document.cookie = NameOfCookie + "=" + escape(value) +
((expiredays == null) ? "" : "; expires=" + ExpireDate.toGMTString());
}
function delCookie (NameOfCookie)
{
if (getCookie(NameOfCookie)) {
document.cookie = NameOfCookie + "=" +
"; expires=Thu, 01-Jan-70 00:00:01 GMT";
}
}
#4 I would suggest you drop outside of your application, write a simple web page which sets and deletes cookies until you have that working using your new widget. Once you have that, then post the code here - GIVE BACK TO THE COMMUNITY.
#5 Once you have the cookie part you need to add some code to the VLF to capture the sign out event...there is something in the FrameWork I think to capture when you try to leave and do a confirm or something...that is where you would put this remove cookie code.
#6 This is not the greatest code in the world, there might be easier code somewhere....do some googling for the JavaScript stuff and you will find many examples
Good Luck.
Paul
Re: How to delete cookie by clicking Sign Out button in VLF Version 13.
If it is possible to change your applications which use cookies, you might want to consider using local storage instead. This can be accessed directly from your VL Web application and the VLF Web as well...so no widget and no JavaScript required.
https://docs.lansa.com/14/en/lansa017/c ... 1_0295.htm
Paul
https://docs.lansa.com/14/en/lansa017/c ... 1_0295.htm
Paul