NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page Help Me With Cookies, HTML and IE8

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search
5 members in live chat ~  


Reply
 
LinkBack Thread Tools
Old 02-13-2011, 04:30 PM THREAD STARTER               #1 (permalink)
NamePros Member
 
xarzu's Avatar
Join Date: Apr 2007
Posts: 28
xarzu is an unknown quantity at this point
 



Help Me With Cookies, HTML and IE8


Help Me With Cookies, HTML and IE8

For complex reasons, I have to use HTML with JavaScript to set a cookie. I know it is easy to set and get cookies PHP but I have to put the code in HTML.

I have searched the internet for some examples and I ran a test based on an example. I ran this Javascript code:
????: NamePros.com http://www.namepros.com/programming/702146-help-me-with-cookies-html-ie8.html
Code:
<SCRIPT LANGUAGE="JavaScript">

function putCookie() 
{
	cookie_name = "specialcookiehuge";
	
 	if(document.cookie != document.cookie) 
	{
		index = document.cookie.indexOf(cookie_name);
	}
	else 
	{ 
		index = -1;
	}

	if (index == -1)
	{
		document.cookie=cookie_name+"; expires=Monday, 04-Apr-2020 05:00:00 GMT";
	}

}
</SCRIPT>
I tested this code by placing alert statements and I nkow that the line:
Code:
document.cookie=cookie_name+"; expires=Monday, 04-Apr-2020 05:00:00 GMT";
gets run.

I tried to find this cookie (Tools --> Internet Options --> Browsing History -->Settings) And I did not find anything named "specialcookiehuge" in "View Objects" or "View Files".

I guess I could try other browsers, but it would be good to know what I am doing wrong. I do not know if I am really setting a cookie. Is there some additional javascript command I am missing? Or, is the cookie being set but I am not looking in the right place according to the tutorials I saw online?
__________________
There is nothing stronger than human will. Nothing can stop it.
xarzu is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Link background image problem in IE8 immediate Programming 3 10-15-2010 02:32 AM
Flash On IE8 Problem dezinerite Web Design Discussion 2 12-18-2009 08:14 AM
Is really wrong to use depreciated HTML? thenext88 Programming 8 03-24-2009 12:04 PM
My CSS must be terrible... DIV not displaying at all in FF3, works fine in IE8 thenext88 Programming 4 03-02-2009 02:01 PM
How can you convert a PSD to HTML? ichsie Programming 0 10-27-2008 07:04 PM

 
All times are GMT -7. The time now is 02:44 PM.

Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger