/    Sign up×
Community /Pin to ProfileBookmark

mmm… cookies

not so sure how cookies work, so I have a question about potentials.
Could I write a cookie w/ no expiration that contains 1 word ie yellow.css then when someone returns to the page, it checks for the cookie and loads the style sheet if existant?

to post a comment
PHP

6 Comments(s)

Copy linkTweet thisAlerts:
@PunkSktBrdr01Feb 26.2004 — If there's no expiration date, the cookie goes away when the browser is closed. You'd have to set the expiration date to be far in the future, and then just renew it when the user returns.
Copy linkTweet thisAlerts:
@SamauthorFeb 26.2004 — Thanks, what about the rest?
Copy linkTweet thisAlerts:
@PunkSktBrdr01Feb 27.2004 — Yeah, the stylesheet thing is definitely possible. Just set the cookie's value to the name of the stylesheet.
Copy linkTweet thisAlerts:
@SamauthorFeb 27.2004 — [i]Originally posted by samij586 [/i]

[B]not so sure how cookies work[/B][/QUOTE]

So, do you have a short script to a) write a string to a cookie and b) read a cookie?
Copy linkTweet thisAlerts:
@PunkSktBrdr01Feb 27.2004 — Check out the [URL=http://us4.php.net/manual/en/function.setcookie.php]setcookie() page[/URL]. If you still can't figure it out, I'll try to write something.
Copy linkTweet thisAlerts:
@SamauthorFeb 27.2004 — aha, thankya very much
×

Success!

Help @Sam spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...