How to delete a cookie and server variable using USP code
Author: jason_zuvela@yahoo.com (jasonzuvela)
Hello
Can someone please provide some example USP code that shows how to delete a cookie and server variable?
I've tried the following but it doesn't seem to work (though I'm not sure since I don't have the tools to read cookies available right now):
;All local variables are strings
;TV_COOKIESOUT already contains a valid cookie from existing code
;Cookie to delete is JSESSIONID
;Server variable to delete is REMOTE_USER
TV_COOKIESOUT = "%%TV_COOKIESOUT%%%·;JSESSIONID=·!·;%%TV_PATH%%%"
$webinfo("cookiesout") = TV_COOKIESOUT
putitem/id TV_SERVERVARIABLES, "REMOTE_USER", ""
putitem/id $webinfo("WEBSERVERCONTEXT"), "SERVERVARIABLES", TV_SERVERVARIABLES
Regards
Jason
Hello,
this way seems to be good.
the following code delete the cookie named MYCOOKIE:
$webinfo("cookiesout") = "MYCOOKIE=·!·;"
With firefox you can use the extension "Web Developer" to scan the cookies.
Hope this help,
Philippe
Author: Philippe (philippe.grangeray@agfa.com)
How to delete a cookie and server variable using USP code
Author: jason_zuvela@yahoo.com (jasonzuvela)
Hello
Can someone please provide some example USP code that shows how to delete a cookie and server variable?
I've tried the following but it doesn't seem to work (though I'm not sure since I don't have the tools to read cookies available right now):
;All local variables are strings
;TV_COOKIESOUT already contains a valid cookie from existing code
;Cookie to delete is JSESSIONID
;Server variable to delete is REMOTE_USER
TV_COOKIESOUT = "%%TV_COOKIESOUT%%%·;JSESSIONID=·!·;%%TV_PATH%%%"
$webinfo("cookiesout") = TV_COOKIESOUT
putitem/id TV_SERVERVARIABLES, "REMOTE_USER", ""
putitem/id $webinfo("WEBSERVERCONTEXT"), "SERVERVARIABLES", TV_SERVERVARIABLES
Regards
Jason
Thanks for the reply.
Am I correct in saying it can be extended as follows:
$webinfo("cookiesout") = "MYCOOKIE1=·!·;MYCOOKIE2=·!·;MYCOOKIE3=·!·;"
Also, any idea how to delete a server variable called REMOTE_USER?
Unfortunately I can't install firefox because I'm not working locally on my PC.
Author: jasonzuvela (jason_zuvela@yahoo.com)
How to delete a cookie and server variable using USP code
Author: jason_zuvela@yahoo.com (jasonzuvela)
Hello
Can someone please provide some example USP code that shows how to delete a cookie and server variable?
I've tried the following but it doesn't seem to work (though I'm not sure since I don't have the tools to read cookies available right now):
;All local variables are strings
;TV_COOKIESOUT already contains a valid cookie from existing code
;Cookie to delete is JSESSIONID
;Server variable to delete is REMOTE_USER
TV_COOKIESOUT = "%%TV_COOKIESOUT%%%·;JSESSIONID=·!·;%%TV_PATH%%%"
$webinfo("cookiesout") = TV_COOKIESOUT
putitem/id TV_SERVERVARIABLES, "REMOTE_USER", ""
putitem/id $webinfo("WEBSERVERCONTEXT"), "SERVERVARIABLES", TV_SERVERVARIABLES
Regards
Jason
I have done a test.
This method only empties the cookies to delete them, instead use:
$1 = "·;expires=0"
putitem/id $webinfo("COOKIESOUT"), "MYCOOKIE1", $1
putitem/id $webinfo("COOKIESOUT"), "MYCOOKIE2", $1
putitem/id $webinfo("COOKIESOUT"), "MYCOOKIE3", $1
Author: Philippe (philippe.grangeray@agfa.com)
How to delete a cookie and server variable using USP code
Author: jason_zuvela@yahoo.com (jasonzuvela)
Hello
Can someone please provide some example USP code that shows how to delete a cookie and server variable?
I've tried the following but it doesn't seem to work (though I'm not sure since I don't have the tools to read cookies available right now):
;All local variables are strings
;TV_COOKIESOUT already contains a valid cookie from existing code
;Cookie to delete is JSESSIONID
;Server variable to delete is REMOTE_USER
TV_COOKIESOUT = "%%TV_COOKIESOUT%%%·;JSESSIONID=·!·;%%TV_PATH%%%"
$webinfo("cookiesout") = TV_COOKIESOUT
putitem/id TV_SERVERVARIABLES, "REMOTE_USER", ""
putitem/id $webinfo("WEBSERVERCONTEXT"), "SERVERVARIABLES", TV_SERVERVARIABLES
Regards
Jason
Good morning fellers,
the deletions of the JSESSIONID wont be that easy ... but in theory your approach is correkt. I take the Cookies-IN list, drop the unwanted cookies and push it back to COOKIES-OUT.
First, we need to look at, where the Cookie is coming from. Usually the Tomcat sets this in the REALM of its URL. Uniface itself runs on another realm (/uniface/wrd/run etc) and so the path differs. I think you wont get the Cookie deleted from within Uniface . The only cookies you CAN delete are those, you set from within Uniface as the realm is the same.
If this against experience will do, then let me know :)
The server variable wont be deleteable as it is an information coming from the server and resides in the CGI-Environment.
Hope this helps you to get along :)
-GHAN-
Author: -GHAN- (hansen@ahp-gmbh.de)