We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
document.cookie
Topic Started: Sep 25 2005, 01:17 PM (407 Views)
Epsilekt
Member Avatar
Member
[ *  *  *  *  *  * ]
Okay, people keep saying that my scripts that use cookies only last until your browser is closed. I investigated. They are correct. Here is the code that I use when I want to set a cookie. What am I doing wrong?

Quote:
 
document.cookie = 'name=value; expires:Fri, June 25 1010; path=/';


Before the expiration date was just fake, but I grabbed a real one, and I made sure it existed. I don't understand what I'm doing wrong.

QuirksMode uses the same cookie format as I do in their cookie tutorials, are they wrong, or am I just doing something incorrectly?

I figured it out.

You have to have a new Date() format of expiriation. Otherwise, it's equal to delete when the browser closes. Is this true? Do you really have to have a whole drawn out date like this one below?

Quote:
 
document.cookie = 'name=value; expires:Sun Sep 19 6:10:10 EDT 2010; path=/';
Offline Profile Quote Post Goto Top
 
SyKo
Member Avatar
aka godman123
[ *  *  *  *  *  *  * ]
Your Javascript skills cease to amaze me.
Offline Profile Quote Post Goto Top
 
Epsilekt
Member Avatar
Member
[ *  *  *  *  *  * ]
godman123
Sep 25 2005, 01:31 PM
Your Javascript skills cease to amaze me.

Thanks, meanie. <_<

I just realized what I've been doing wrong my whole life... <_<

expires:...

Jesus.

It's suppose to be expires=...

<_<

And oh, look. The cookies are working now. <_<
Offline Profile Quote Post Goto Top
 
TK3+
Member
[ *  *  *  *  * ]
Epsilekt
Sep 25 2005, 12:42 PM
godman123
Sep 25 2005, 01:31 PM
Your Javascript skills cease to amaze me.

Thanks, meanie. <_<

I just realized what I've been doing wrong my whole life... <_<

expires:...

Jesus.

It's suppose to be expires=...

<_<

And oh, look. The cookies are working now. <_<

Calm down.
Offline Profile Quote Post Goto Top
 
Epsilekt
Member Avatar
Member
[ *  *  *  *  *  * ]
TK3
+Sep 25 2005, 07:33 PM
Epsilekt
Sep 25 2005, 12:42 PM
godman123
Sep 25 2005, 01:31 PM
Your Javascript skills cease to amaze me.

Thanks, meanie. <_<

I just realized what I've been doing wrong my whole life... <_<

expires:...

Jesus.

It's suppose to be expires=...

<_<

And oh, look. The cookies are working now. <_<

Calm down.

...

Don't worry, I was while posting that, and still am. ;)
Offline Profile Quote Post Goto Top
 
TK3+
Member
[ *  *  *  *  * ]
You were while? O_o
Offline Profile Quote Post Goto Top
 
Epsilekt
Member Avatar
Member
[ *  *  *  *  *  * ]
TK3
+Sep 26 2005, 06:53 PM
You were while? O_o

Yes, I was. Show me how you think I wasn't.
Offline Profile Quote Post Goto Top
 
TK3+
Member
[ *  *  *  *  * ]
Epsilekt
Sep 26 2005, 06:16 PM
TK3
+Sep 26 2005, 06:53 PM
You were while? O_o

Yes, I was. Show me how you think I wasn't.

What does it mean to be while?

Epsilekt
Sep 26 2005, 05:00 PM
TK3
+Sep 25 2005, 07:33 PM
Epsilekt
Sep 25 2005, 12:42 PM
godman123
Sep 25 2005, 01:31 PM
Your Javascript skills cease to amaze me.

Thanks, meanie. <_<

I just realized what I've been doing wrong my whole life... <_<

expires:...

Jesus.

It's suppose to be expires=...

<_<

And oh, look. The cookies are working now. <_<

Calm down.

...

Don't worry, I was while posting that, and still am. ;)
Offline Profile Quote Post Goto Top
 
Multikill
Member Avatar
SLAYER EATS PLATIPUS?!?!
[ *  *  *  *  *  * ]
He was calm while posting that.
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Technology Chat · Next Topic »
Add Reply