Welcome Guest, Not a member yet? Register   Sign In
cookie :: not wokting :: plz help me...........
#1

[eluser]Unknown[/eluser]
$number_of_days = 30 ;
$expire = time() + 60 * 60 * 24 * $number_of_days;
$path = '/';
$domain = 'www.mysite.com';

set_cookie('cookie_first_name', $this->input->request('first_name'), $expire, $path, $domain);
set_cookie("cookie_last_name", $this->input->request('last_name'), $expire, $path, $domain);
set_cookie("cookie_state", $this->input->request('state'), $expire, $path, $domain);
set_cookie("cookie_email", $this->input->request('email'), $expire, $path, $domain);
set_cookie("cookie_remember_me", $this->input->request('remember_me'), $expire, $path, $domain);

Not worked.................. when we get cookies from other method.
how to solve this problem?
#2

[eluser]gyo[/eluser]
Hi, you can check the following:

- The cookie name has no spaces or special characters: cookie_name = wrong, cookiename = correct.
- Try omitting the www in the domain: mysite.com.
- Not sure about this... but if you try to read the cookie values right after you stored them, you could expect it not to be working. This because there's a little delay between the server sending the information and the browser storing it.
- Manually check in your browser if the cookie has been written

Hope it helps!
#3

[eluser]Unknown[/eluser]
I like to use the native php session, so I created a class based on this:
http://codeigniter.com/wiki/Native_session/

take a look sometimes it can help you
#4

[eluser]WanWizard[/eluser]
These are typically values you save in a session, not in individual cookies (note: there is a limit to the amount of cookies you can create).

Check the user guide, session library. No need to go third party.




Theme © iAndrew 2016 - Forum software by © MyBB