bcit-ci / CodeIgniter

Open Source PHP Framework (originally from EllisLab)
https://codeigniter.com/
MIT License
18.27k stars 7.61k forks source link

Codeigniter 3.1.6 Session not working properly with PHP 7.1.7 #5363

Closed taegyunum closed 6 years ago

taegyunum commented 6 years ago

Hi, session library isn't working fine with PHP 7.1.

It seems to be ok with PHP 5, but still there exist problem on Codeigniter 3.1.6.

Temporary working solution is below.

  1. edit system/libraries/Session/Session.php, comment below codes
    //     session_start();
// Security is king
//    ini_set('session.use_trans_sid', 0);
//    ini_set('session.use_strict_mode', 1);
//    ini_set('session.use_cookies', 1);
//    ini_set('session.use_only_cookies', 1);
//    ini_set('session.hash_function', 1);
//    ini_set('session.hash_bits_per_character', 4);
  1. add session_start(); at top of /index.php

this bug seems to be fixed and updated in next release.

plonknimbuzz commented 6 years ago

can you provide more information? and what's your problem? if you want activated session, please enable session class in autoload.php and then you dont need to write session_start() anymore

your update php 5.3 into 7.1 is not the problem. because actually 4 days ago i was updating my old project from CI 2.x.x and PHP 5.2 into CI 3.x.x (lastest) and PHP 7.1 (lastest xampp) and they works fine (ofc in session too)

narfbg commented 6 years ago

There's plenty of people using CI 3.1.6 on PHP 7.1 and it works just fine ... you can't just say it doesn't work. Even if something doesn't work for you, the details around it are important.

But more importantly, your "temporary working solution" is effectively the same as not using CI_Session. If you won't want to use CI's session library, that's fine, but don't publicly suggest commenting out code from the framework. Not least because this is a bug tracker, not a micro-blogging platform. You can post on our forums if you're just looking for help and/or to help others.

And finally:

this bug seems to be fixed and updated in next release.

There's have been no changes to CI_Session since the 3.1.6 release ... This doesn't make any sense.

narfbg commented 5 years ago

Yeah? Let's see if you actually know anything ...

All they say is "it works for me" and blame and gets mad at their own clients for having the issue.

First of all, I challenge you to find me saying "it works for me" anywhere. And I do mean anywhere, not just on this repository. Go dig up every comment or statement I've ever written on the internet; you won't find me saying that, because I never do. What I said here is that there's plenty of other people for whom "it works" as an observation, and as a preface to why one should provide details instead of just saying "it doesn't work".

Secondly, I have never blamed anyone for having any issue and I challenge you to find an instance of that too. What I got mad about is the posting of a random suggestion to modify stock framework code, and a very bad one too - what those modifications do is plain dumb, and there's multiple easier ways to achieve the same effects even if you want the dumb thing.

And finally - I don't have clients. OP is not my client, you're not my client, nobody is my client. I don't get paid for any of this, not even indirectly - no ads, no consulting business on the side, no nothing. You should keep note of that before expecting anything from me.

I've been seeing narfbg's comments about this topic on multiple platforms with people mentioning the same error and his comments are pretty much the same. This guy won't accept any comment about his precious CI_Session library and his responses are a little toxic.

About which topic? About which same error? And if I won't hear anything about it, who fixes all of the bugs? You say that like all issues are the same and I have a magic "fix problem" button at my fingertip that I simply have to press when I feel like it. I can be harsh towards unreasonable people, but "toxic" is a projection.

At the end of the day, the CI_Session was updated to fix this, for example, http://tekina.info/solving-session-problems-codeigniter-upgrading-php-version/

So, all I do is say it "works for me" and I won't hear anything about "my precious CI_Session library", yet at the end of the day it was updated to fix "this", despite me being the only one able to do such an update and nobody knowing what "this" is? And the link (which btw, could've just said "do your updates") you referenced was published 3 months before this issue was opened and talks about changes that I made over a year before this issue was opened and released in 3.1.2.

Funny how all of that works.

I was having this same problem and the solution on the first comment worked for me. I don't work with CodeIgniter anymore but this is a particular client that don't want to migrate. And more a Laravel guy.

You don't know if you had the same problem. Nobody knows if they have had the same problem. Nobody knows what the problem here was, because the problem was never described. And do you even know what "the solution" that "worked for you" (wink, wink) does? It effectively disables CI_Session; it's the same thing as not loading the library and just calling session_start() instead. So if you had to get that "solution" from here, you have no idea what you're doing and you should be ashamed for charging clients for your incompetence.

And what is it with you Laravel guys, always itching to spew your negative opinions here and especially to mention that you're a "Laravel guy". Why is it that it's never a Symfony, ZF, Slim, Yii or any other framework guy? At least those frameworks are based on completely different ideas and so are naturally opposed to what CI does; Laravel is heavily influenced by CI, and I don't know about now, but earlier versions even included CI code (parts written by me too). You had no idea of that either, did you?

So, if you think about, you don't know shit and you're just an ignorant troll, and you want to call me toxic.

plonknimbuzz commented 5 years ago

hi narf, i use CI since 1.x and work use other framework & CMS too. I cant write too long sentences. Because my english so poor. But let me tell you what i feel when i read this.

Thanks for everything You give me job, you give me (and my family) the money. But i never give you anything, instead of reporting the bug, asking a question, etc. Sorry for this.

I never force someone here (github and SO too) to solve my problem, because i dont pay them and they are not get any benefit when they solve my problem, instead of me.

I dont know how hard your day, but in my subjective opinion, at this day

No PHP programmer who not know what is Codeigniter.

we cant make every people happy, even we are doing a good thing. Just ignore them.

And the last. Maybe you dont know how happy i am when my problem solve by you, i jump from my chairs and yelling. "YESSSSS, my problem solved by MASTER". Its like i have problem with my windows then Bill gates answer my question.

Thanks for everything.

cristianfx commented 5 years ago

That's a good reply plonknimbuzz, thank you!

narfbg commented 5 years ago

@plonknimbuzz Thank you, I wasn't looking for praise, but I appreciate that.

You don't need to be sorry for anything (especially not for reporting bugs - that's contributing) and while I'm glad you think highly of me, I really don't want to be thought of as a "master" or some other kind of supreme being. As long as you're being a reasonable person, that's good enough for me.

ubong-essien commented 5 years ago

This is still not fixed are we expecting a fix in the next version?...meanwhile this temporary fix looks like trouble to me

ubong-essien commented 5 years ago

sorry am currently using version 3.1.10 and am still having the issue.