Welcome Guest, Not a member yet? Register   Sign In
set_cookie problem =/ ~ beginner
#1

[eluser]cehennem[/eluser]
I am trying to set a cookie like this;

set_cookie('username', $this->input->post('user'), 10); // 10 secs for test

it doesn't work for me.

But when I try higher values such as 5000, 30000 etc, it works nice (not sure when it's going to be expired)

I haven't post the full code coz of that interesting issue. It doesn't accept my small number of seconds.

Can somebody tell me whats wrong?
#2

[eluser]mvdg27[/eluser]
My first ques would be that it has to do with a mismatch of the time on you local computer and on your server.

Let's say your server thinks the time is: 12:00:00, and set's a cookie with a 10 second time to live, and on you local PC the time at the same moment is set to 12:00:11, then the cookie will never exist ..
#3

[eluser]cehennem[/eluser]
oh nice guess! my server time was about 2 hours back.. solved thanks Wink




Theme © iAndrew 2016 - Forum software by © MyBB