Welcome Guest, Not a member yet? Register   Sign In
Cookie Helper default expire time
#9

[eluser]sophistry[/eluser]
hi pascal,

thanks for burnishing my credentials! ;-) i'm flattered my opinion weighs so much. :red:

here's my reasoning as to why the doc should be updated:

the function is named set_cookie(). that is what it should do. now, the manual says “Only the name and value are required.” if you pass it just those two parameters - name and value - it <strong>deletes</strong> the cookie (it does not set, it deletes). expire <strong>is</strong> required if you want the function to set a cookie. if you don't set the expire parameter, then the cookie isn't set - simple as that. if you follow the doc instructions to the letter, you end up here at the forums, searching on set_cookie() and muttering fresh words to the computer screen. Wink

besides, there is already a function called delete_cookie(). so, there is no need for the set_cookie() function to do delete_cookie()'s job. further, why would you send a value parameter to set_cookie() if all you want to do is delete it? meaning, delete_cookie() only makes you send the name of the cookie - which is perfectly clear. but, set_cookie() makes you send three parameters just to delete the cookie. this is evidence of a vestigal behavior of this function and it should be expunged or (at the very least) clarified in the docs.

in this case, the documentation is just plain wrong and should be fixed before someone else wastes time on it.

to take this one step more... the "delete cookie" functionality of set_cookie() should be deprecated since it is available in a simple, clear, well-named function delete_cookie().


Messages In This Thread
Cookie Helper default expire time - by El Forum - 05-04-2008, 10:53 PM
Cookie Helper default expire time - by El Forum - 05-05-2008, 05:10 AM
Cookie Helper default expire time - by El Forum - 05-05-2008, 05:36 AM
Cookie Helper default expire time - by El Forum - 05-05-2008, 04:12 PM
Cookie Helper default expire time - by El Forum - 05-05-2008, 07:14 PM
Cookie Helper default expire time - by El Forum - 05-05-2008, 07:35 PM
Cookie Helper default expire time - by El Forum - 08-12-2009, 09:07 PM
Cookie Helper default expire time - by El Forum - 08-13-2009, 05:55 AM
Cookie Helper default expire time - by El Forum - 08-13-2009, 08:06 AM



Theme © iAndrew 2016 - Forum software by © MyBB