Sessions dilemma.

#1
[eluser]voltechs[/eluser]
Hey guys.

CI's session management, (despite claims in its user guide) is not flexible. For me anyway.

See, I'm building a "plugin" for the community, so I wanted to use the built-in support for sessions due to the likely hood of users using them. I wouldn't want to write a plugin that, in order to install it, you would have to create a folder and give it the correct permissions just so that the plugin would work. I can't count on users having that kind of access to their servers (or can I?) so that was my reason for going with CodeIgniters sessions (little did I know it's just a cookie, not really a session). Anyway, I guess this simple fact is what prevents me from performing various fancy-footwork to get things done in an "elegant" fashion.

So it really boils down to being between a rock and a hard place. I could either require users to create a "sessions" folder, and give it the correct permissions and everything would work handy-dandy with my own implementation and management of sessions, or I could stick with CI's sessions and have to live with various bugs throughout the plugin (such as the user getting logged out when I try to update the session data from various parts of the app). Anyway, more of a question of opinions, but heck, if you have any solutions, lemmy at em!

I won't dismiss the possibility that I'm crazy.

Cheers!

-- volte

P.S. this may become completely moot, as I am debating expanding the plug-in into a full-fledged CI app. I'll have everyone weigh in when I release the beta here shortly.

EDIT: Woot! http://www.codeigniter.com/wiki/Native_session/

I'm leaning more and more to a full-fledged app, but dang, thats really not what this plugin was originally targeting :/

#2
[eluser]Michael Wales[/eluser]
Quote:such as the user getting logged out when I try to update the session data from various parts of the app

That one line right there let's me know you need to rethink how you attack certain parts of your application.

#3
[eluser]voltechs[/eluser]
[quote author="Michael Wales" date="1198029363"]
Quote:such as the user getting logged out when I try to update the session data from various parts of the app

That one line right there let's me know you need to rethink how you attack certain parts of your application.[/quote]

Heh I had a feeling someone might bring that up. It would log the user out when I update a session variable after some code. I could post the code, but its moot at this point because of the library I found. Much much better than CI's native session library. It's working like a charm.

Thanks!

-- volte

#4
[eluser]PenguinMan98[/eluser]
I'm kinda doing the same thing and getting the same problem.

What's wrong with how I'm 'attacking' my application?

LOGIC:
User submits a form.
Form is checked and if good, user is re-directed to a new page.
The new page does an RPC to check some of the form data.
If the data doesn't check out,
--set a session variable,
--redirect the user back to the form.
Display the error message on the form.

What Happens:
User submits a form.
Form is checked and if good, user is re-directed to a new page.
The new page does an RPC to check some of the form data.
If the data doesn't check out,
--set a session variable,
--!<SESSION IS DESTROYED FOR SOME REASON>!
--redirect the user back to the form.
Does not display the error message on the form.

I check the session variable before I set it and after I set it. It is empty before and has the value I assigned afterward. Then somehow, during the re-direct, the session is destroyed.

Help me understand why this does not work please.

#5
[eluser]Riju Francis[/eluser]
I am creating session variables during login (using Freakauth - ci_sessions). In my application, I also need to store other variables in the session. But once that is done, the login variables in session cannot be retrieved and the login session expires.
Has anyone been able to solve this issue?

#6
[eluser]zzet[/eluser]
@Riju Francis:
I'm having the same issues here with FreakAuth and the Language-Selection-Library (http://ellislab.com/forums/viewthread/49840/).
FreakAuth works well until I activate the Language-Selection-Library which stores the selected language in a cookie.
Any ideas on how to make FreakAuth and the language selection working together?

#7
[eluser]mrbinky3000[/eluser]
FACT: CodeIgniter's Session Class is NOT RELIABLE.

CI's session class uses cookies. The cookies they write are standards-compliant, but don't work with IE. So, the problem is with CI's refusal to work around IE's non-standards-compliant handling of cookies. Meanwhile, the rest of us have to suffer because of CI's refusal to get off their high-horse and make something that works in the REAL WORLD.

Check out this thread for a working solution.
http://ellislab.com/forums/viewthread/130577/#669025

Also in the wiki.
http://codeigniter.com/wiki/Dariusz_Debo...ion_Class/

Please contribute to Dariusz Debowczyk's Session Class. My hope is that enough of us can get together and make a session class that works.

#8
[eluser]jedd[/eluser]
a) A bit rude to hijack a 2 year old thread.
b) Quite a big call to make.
c) Do you mean (all versions of) IE, or just IE 6?

You make two interesting, and contradictory claims:
[quote author="mrbinky3000" date="1258669042"]
The cookies they write are standards-compliant ...
[/quote]

Quote:So, the problem is with CI's refusal to work around IE's non-standards-compliant handling of cookies.

A sane person might suggest the actual problem is that some unspecified version of IE is not standards-compliant.

#9
[eluser]mrbinky3000[/eluser]
a) Not trying to be rude. I was trying to get input from people having a similar problem.

b) Yes, it is a big call.

c) All versions of IE.

And lastly.

I fully recognize that IE is a heap of poop. It still doesn't change the fact that I, and thousands of other CI users have to deal with IE. And furthermore, PHP's native session functions found a way to work around IE's shortfalls. So why did CI decide to replace PHP's session-handling functions with their own functions that refuse to accommodate IE? CI's choice makes CI LESS FUNCTIONAL.

I thought CI was supposed to make coding easier? Now I find, when it comes to CI's session class, I have to fight through waves of CI uberfans telling me that "CI is perfect, blame Microsoft" in order to get a real world solution. I want to code, I don't want to have to fight my way though political ideologies and zealots to do so.

CI's Session class is broken. Period.

Fix it or nix it.
Mend it or end it.

#10
[eluser]jedd[/eluser]
[quote author="mrbinky3000" date="1258671359"]
a) Not trying to be rude. I was trying to get input from people having a similar problem.
[/quote]

My point is that jumping onto a 2-year old, inactive thread is not the best way of going about this.

Quote:... I have to fight through waves of CI uberfans telling me that "CI is perfect, blame Microsoft" in order to get a real world solution. I want to code, I don't want to have to fight my way though political ideologies and zealots to do so.

Yes, quite. You're certainly not coming across as fanatical at all.

Anyhoo, I suggest you start a new thread, clearly describing your problem(s), providing code, walk-throughs on how to recreate the problem, etc.

Pointing at old threads that have been (AFAICT) pretty much debunked, and hinting at the nature of your current woes, isn't hugely helpful. I know that n0xie, and presumably others, have previously addressed some or all of the concerns you've raised. This might explain why you're being vague here and just asserting 'it's broken' - rather than being a bit more concise in your bug report.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.