V.Rashkov
V.Rashkov

Reputation: 1735

Codeigniter 2x firefox session

I have problem with the sessions in firefox browsers, everything works in Chrome and IE - it saves sessions correctly , but Firefox doesn't . I've tried with Native sessions to save in the db the session - in FF it saves it but again not working, just after login to the page it redirects as if I'm not logged in.It does this things only in FF. I saw other questions like this and from them I saw the Native session classs, but no use.

Upvotes: 7

Views: 1165

Answers (3)

Nassim
Nassim

Reputation: 2876

if CI session class is not working with only Firefox then it's a cookies issue. enable cookies for your domain name under Fifrefox as following

tools->options->privacy->history: use custom settings for history; check "accept cookies" and add your domain to your exceptions, allow your domain www.your_domain.com and that's it;

more details in this link for different FF versions:

http://www.wikihow.com/Enable-Cookies-in-Firefox

Upvotes: 0

Noor
Noor

Reputation: 1391

For this same problem I use the following header in Controller constructor and it did the trick.

header('P3P:CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"');

Upvotes: 2

jtavares
jtavares

Reputation: 449

I had a similar problem on codeigniter, what happened is that my user agent had to many characters for the custom DB field that CI documentation tells you to create.

try making and alter table to change the user_agent field on ci_sessions and check again if firefox works.

ALTER TABLE `ci_sessions` MODIFY COLUMN `user_agent` VARCHAR(160) not null 

Upvotes: 0

Related Questions