For autostart I know that the cookie is set by default to expire at the end of session (closing of browser) How could we go about setting an expiration date for these? I like using the autostart and I like that it only works once per session but I want it to not open anymore unless that cookie is deleted .. I imagine something like this could be added into the js itself? Im really not sure but would certainly appreciate any help you might be able to give.
Happy Thanksgiving by the way!
Setting cookie expiration
Page: 1
Author | Post |
---|---|
netslider
|
#1 Wed Nov 26, 2008 2:10 am
|
Guest | |
#2 Wed Nov 26, 2008 3:18 pm
|
|
Administrator
Registered: Aug 2008
Posts: 3382
|
You're reviving this topic are you???
The autoStart:once capability is session-based and there currently is no way to set a date-based duration (but you already know this). You could hack the code by finding where the autoStart:once cookie is set and adding a date to that cookie. You would of course have to re-do the hack each time you moved to a new version. I'm looking at handling different durations for autoStart. The cookie management for this is a bit of a challenge as it would have to support different autoStart pages with different durations from the same site. If I can't do it simply with a few lines I probably won't proceed as there isn't enough bang-for-the-buck for a lot of code. Unrelated... Us Canadians have the good sense to hold our Thanksgiving on the 2nd Monday of October when the harvests have just finished coming in and Christmas turkey is still some time away. But good cheer and happy Thanksgiving to all you whacky Americans who like to put your two big turkey dinners of the year within a month of each other. |
netslider
|
#3 Wed Nov 26, 2008 7:08 pm
|
Guest |
Thanks for your quick reply. I am guessing this setting is going to be found somewhere in the js, right? Could you give me a hint as to where it might be in there? I found only three entries for cookies but I cannot figure out which.. I have a BASIC idea as to how to add the expiration but I am not getting it
LOL actually a lot of people have turkey on Thanksgiving in November here in the States but come Christmas they have either goose or ham ![]() Two turkey dinners within a month of each other is rather ridiculous lol! |
#4 Thu Nov 27, 2008 12:17 am
|
|
Administrator
Registered: Aug 2008
Posts: 3382
|
A couple of small hints for you, but beyond that I'm not going to get involved with helping to customize the code.
The cookie is named fbAutoShown. A good description of working with cookies in javascript can be found here. |
netslider
|
#5 Fri Nov 28, 2008 5:39 pm
|
Guest |
Got it! For those that wish to do the same.. open your editor and find 'fbAutoShown'
A few lines down from the result you'll find (document.cookie = 'fbAutoShown=' + val + href + '; path=/';) merely add expires and when. Must be in Greenwich Time. So, I did this, document.cookie = 'fbAutoShown=' + val + href + '; expires=Thu, 2 Aug 2035 20:47:11 UTC; path=/'; I checked the cookie in the browser and sure enough, it now shows an expiration of Thursday August 2nd 2035 3:47pm Thanks for the hint admin! I will also remember that each time there is an fb update that this needs to be added to the js. So easy! Thanks my God thanks!! |
Page: 1