Hmmmm...sounds like a good suggestion, but I'm confused. At which point should I be ESCAPING and UNESCAPING the string?
Should I escape it before storing it in document.cookie, as below?
document.cookie = escape(test);
Then at which point do I unescape it? When I assign the
window.location...
In my code I have a drop-down menu that redirects and sets a cookie. The value of one of the options selected is the following:
<option value="<isa:webappsURL name="/b2b/init.do"/>?shopId=COMPANY&<%= request.getQueryString() %>">United States</option>
Redirection works when...
Can I have more than one argument serve as the delimiter in the SPLIT method? Whenever I read about SPLIT, I read about passing one delimiter to it. However, I need to split a string on encountering both an "=" sign and a ";". Is there a way to do it?
Thanks
How would I go about resolving this situation then? From what you're saying it seems that setting cookies with Javascript won't work, because JSP does what it wants. I know nothing about JSP, and I'm merely trying to add my HTML and Javascript code to a kind of template used here at the...
I have a JSP page with some embedded javascript. When the page loads, it tries to detect the presence of a cookie by means of the "if (document.cookie.length > 0)" javascript statement. The strange thing is that, without a cookie present, the "document.cookie.length" statement returns either...
I've noticed something strange...to make sure that my javascript wasn't failing because of my html references or some file browsing issue, I decided to use the addresses of famous search engines as the values to assign to the variable URL. What's strange is that the cookie file stored on my...
Might it have something to do with IIS??? The following is the message I get when the first redirection is attempted:
The page cannot be displayed
The page you are looking for cannot be displayed because the page address is incorrect.
_____________________________
HTTP 405 - Resource not...
I did as you suggested, and the results, ironically enough, are exactly the same. Ie, redirection fails when you click on GO and the cookie is set, but it works when you open up the page once the cookie has been created. Strange!!!!!
Okay, I feel I'm on the final lap.
Chessbot, the capitalization suggestion solved the biggest problem, ie the function not running.
I've made a few modifications to the code, based on all of your suggestions. I have added some alerts to also debug better. There is one last problem I'm facing...
Wow, I'm baffled. cLFlava, I made the change you suggested and it fixed that part of the code. The problem is that the cookie is still not being written. In fact, I added an alert box in the third line of the SetCookie function just to see whether that function was being run at all:
function...
That solves part of the problem. However, the cookie setting-page never loads, because I am being redirected as soon as the page loads. There is a flaw in my code logic, and I think it is because I am not properly detecting the absence of a cookie. In my original code (posted above), I have...
I have a simple webpage to test the functionality of a cookie. THe user chooses an animal from the menu, and if the checkbox is selected, the cookie is written and the document loads another page. After the cookie is set, a ReadCookie function is called to redirect the user.
When I click on...
I have a main page where the user selects a chocolate maker from a drop-down menu, and checks the "Remember my selection" box to have the browser set a cookie. This page doesn't work. When I select a region and click on the submit button, I get a "The page cannot be displayed" page. I don't...
my $cookie_out" is above the if statement, as you posted in your code...but the cookie isn't being created. Here is the code. Thanks
use CGI qw/:standard/;
my $query = new CGI;
my $cookie_in = $query->cookie('region');
if ($cookie_in) {
if ($cookie_in eq "americas") {
print...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.