FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » setcookie() Expiration
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: setcookie() Expiration [message #171069 is a reply to message #171067] Wed, 22 December 2010 08:30 Go to previous messageGo to previous message
alvaro.NOSPAMTHANX is currently offline  alvaro.NOSPAMTHANX
Messages: 277
Registered: September 2010
Karma:
Senior Member
El 22/12/2010 0:45, Tyrone Slothrop escribió/wrote:
> I am having problems setting a cookie to expire in the future rather
> than at end of session on a particular server. I can upload the code
> to another server and the cookie expiration is correct. I checked the
> server time and it is correct.
>
> I have even tried simplifying the code to essentials and it will not
> work.
> setcookie ('cookie_name', 'cookie_value', time()+(60*60*24*7));
>
> What is even more frustrating is that code I wrote years ago which
> used to work, now does not. I have tried in multiple browsers and all
> have the same problem. This pretty much narrows it down to the
> server.
>
> This is a leased server running CentOS and cPanel and all updates to
> PHP, etc. are current within a month or two. I have root access.
>
> Anyone else run into this problem?

The first step is to inspect the output of setcookie(). You can see the
raw HTTP header with many tools, such as the Firebug extension for
Firefox, but most browsers have a builtin cookie manager as well.

Also, make sure you are using a valid domain name for your tests.



--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://borrame.com
-- Mi web de humor satinado: http://www.demogracia.com
--
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: The Future of PHP
Next Topic: what all languages i want to learn to make a social networking site?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 30 09:38:38 GMT 2024

Total time taken to generate the page: 0.03816 seconds