Sessions CI 1.7 |
[eluser]cojogrizli[/eluser]
How can I store cookies after close the browser. I've set $config['sess_expiration'] = 0; but is not working. I'm not using sessions database. I've just only need to store the info on the disk and use it the next time when I open the browser. This is the code that I'm using: Code: function addCookieVisit($id)
[eluser]WanWizard[/eluser]
This has nothing to do with sessions, you're just manually creating cookies. For which you set an 'expire' value of zero, which means 'valid till end of browser session'.
[eluser]cojogrizli[/eluser]
I've tried only with the sessions data but even that info was deleted. Which is the option to keep alive the cookies when reopen the browser?
[eluser]WanWizard[/eluser]
You have to set a proper expiration time: http://php.net/manual/en/function.setcookie.php For session cookies, if you set the expiration in the config to zero, the cookie will have an expiry of 2 years. If cookies disappear after you closed the browser, did you instruct the browser to clean up cookies? Are they set at all? So if you don't close the browser, and load another page, is the session the correctly loaded? Which browser are we talking about. Especially IE is very sensitive to proper information, like domain and path. Assuming you have set your base_url properly, you can do this Code: $base_url_parts = parse_url($config['base_url']); |
Welcome Guest, Not a member yet? Register Sign In |