[eluser]WanWizard[/eluser]
@ajaxian64:
as
clear as possible: I've never lost a session, not with any browser.
You just need to configure it properly:
- no underscore in the cookie name
- cookie hostname and path must be correct
- hostname needs to be valid (needs one, in some case two dots in the name, so localhost is invalid!)
- make sure the time on the server is correct ( ntp )
- when using timeouts, cater for users in different timezones
- when using timeouts, cater for users with an incorrectly set PC clock
- when using ajax, avoid a sess_update() call for ajax requests ( search the forum for a solution )
When using a client-side solution that can't sent cookies (p.e. swf's), have it send the session_id as a post variable. Then extend the session library, so that it checks for this variable via $this->input->post() when the cookie can not be found, and use that to load the session instead.