Welcome Guest, Not a member yet? Register   Sign In
Sessions
#1

[eluser]Doodlez[/eluser]
I read the Sessions information in the manual and read through the sessions source. It seems like everything needed for an authentication system is not only included but well constructed for a log in system.

I looked about for some more documentation on sessions but couldn't find it, can any one link me to some more information?

Whats the timing on calls to session in CI if I have it set to auto-load ?

Also sessions are set to regenerate every so often if I have custom data stored into one is it going to naturally keep that data. Say I have email saved into the cookie when the cookies time expires will the session regenerate email into the field or is it going to replace what I saved into the cookie?
#2

[eluser]Bart v B[/eluser]
i don't know where you have your seach but this is explained very well i think:
http://ellislab.com/codeigniter/user-gui...sions.html

for cookies:
http://ellislab.com/codeigniter/user-gui...elper.html
#3

[eluser]skunkbad[/eluser]
Another tip: don't expect CI sessions to act like the php $_SESSION. CI sessions are just cookies, unless you integrate with a database.
#4

[eluser]Doodlez[/eluser]
That does not answer the questions I asked Tongue Thats cool though. I believe that I even referred to them as cookies and said I read those documents. (sessions and cookies are totally the same thing well sorta a session is just pass by reference I like to think Smile

A bit of answering myself though. After reading the source which by the way is super clean, It really does have this natural flow to it, I found that the constructor for CI_Session's calls the routines so any modifications to sessions to create a log in routine can be done directly to the CI_Sessions file.

Hell I never even though of doing something like that It's like getting schooled in programming. Flow man you got it.

I am assuming that auto-loaded libraries are loaded some where around here

*Instantiate the base classes
$CFG =& load_class('Config');

the only thing is that I can't find the exact line of code that loads the auto-loads I'm sure I am just missing its just one little line of code some where..... It is an important line of code though since I really want to have control over the timing of authentication.
#5

[eluser]Doodlez[/eluser]
all bow down to Grep lord of the other world.

all auto loaded classes are loaded by the function _ci_initialize() which is called by the constructor of the Controller class. _ci_initialize() is also a function of the Controller class .

Which means that if you are using an extension to the Sessions library for user authentication non registered users could theoretically view cached files?!?!?!!? I am glad that I checked.

So I am thinking that the cleanest way to implement a log in would be to extend the Sessions class to authenticate users and then have the sessions class load as a pre_system hook.

Any opinions?
#6

[eluser]InsiteFX[/eluser]
Use database sessions!

InsiteFX
#7

[eluser]taewoo[/eluser]
Why are you reinventing the wheel? Use freakauth/ez auth/redux auth libraries... already solved,




Theme © iAndrew 2016 - Forum software by © MyBB