CodeIgniter Forums

Full Version: Session Library and browser settings...
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]Prullenbak[/eluser]
Hello all!

A question about the way Codeigniters session library handles data...

I build an application that makes extensive use of the session library. To remember where someone came from, to keep someone logged in, etc...

The problem is, when someones browser is set to never ever accept cookies (which appears to be the default settings for a lot of iphones/android phones ??), Users can hardly use my site, because the sessions just won't work.

Is there a workaround for this problem? I've found some solutions that change the library to work with native PHP sessions, but te newest one I saw, was for version 1.5...Of course, I could also rewrite my application to use the $_SESSION array instead of $this->session->...etc...But that would be a lot of work and almost asking for errors and mistakes.

Can someone help me?

Thanks a lot in advance!

El Forum

[eluser]CroNiX[/eluser]
If you can't use cookies, the only other way to pass the session id is through the URL which won't play nice with CI out of the box. Native PHP Sessions use either cookies or a url parameter as well - they're the only 2 ways to do it.

Personally, I'd just put a message up that the site relies heavily on cookies and to have them enabled to use the site properly. I don't think that's unreasonable and millions of sites do that. You can spend a hell of a lot of time trying to get your site to work for 1-2% of people and you still won't cover all scenarios with all browsers and their individual security settings/anomalies. Try going to other sites and turning cookies off and see how they work. Even very large extremely popular ecommerce sites...

El Forum

[eluser]Prullenbak[/eluser]
Thanks for your answer. As you said, I've found out even facebook won't work when you turn off all cookies in your browser. I'll go with a message as well. I'm just afraid all this cookie-talk will become quite confusing for some users...Oh well Smile

Just for my understanding of the way php works: are you saying even the standard $_SESSION stuff of php won't work if the browser is set to 'never accept cookies' ?

El Forum

[eluser]Prullenbak[/eluser]
Thanks for your answer. As you said, I've found out even facebook won't work when you turn off all cookies in your browser. I'll go with a message as well. I'm just afraid all this cookie-talk will become quite confusing for some users...Oh well Smile

Just for my understanding of the way php works: are you saying even the standard $_SESSION stuff of php won't work if the browser is set to 'never accept cookies' ?