Welcome Guest, Not a member yet? Register   Sign In
Anyone using the session library just for the flashdata?
#1

[eluser]nuwanda[/eluser]
I'm using native PHP sessions but find the flashdata methods really handy.

Of course that means I'm autoloading the CI session library to take advantage of the flashdata methods.

That means I'm loading a script and only using part of it's functionality.

I messed around with passing session vars to my views but the flashdata is really nice. Ya know, one less problem.

Anyone got the same setup? Any better way to do it?
#2

[eluser]skunkbad[/eluser]
[quote author="nuwanda" date="1275748441"]I'm using native PHP sessions but find the flashdata methods really handy.

Of course that means I'm autoloading the CI session library to take advantage of the flashdata methods.

That means I'm loading a script and only using part of it's functionality.

I messed around with passing session vars to my views but the flashdata is really nice. Ya know, one less problem.

Anyone got the same setup? Any better way to do it?[/quote]

This is exactly what I do. I don't feel that using CI sessions gives me the same functionality that $_SESSION does, but using the flash sessions of CI is pretty handy. If I took time to make a flash session for $_SESSION, then I wouldn't need CI sessions at all!
#3

[eluser]n0xie[/eluser]
[quote author="skunkbad" date="1275781815"]I don't feel that using CI sessions gives me the same functionality that $_SESSION does[/quote]
Wait what...?
#4

[eluser]skunkbad[/eluser]
[quote author="n0xie" date="1275922319"][quote author="skunkbad" date="1275781815"]I don't feel that using CI sessions gives me the same functionality that $_SESSION does[/quote]
Wait what...?[/quote]

$_SESSION (by default) destroying itself on browser close is just one example.

Why try to improve something that works perfectly?
#5

[eluser]danmontgomery[/eluser]
http://codeigniter.com/wiki/Native_session/
#6

[eluser]skunkbad[/eluser]
[quote author="noctrum" date="1275951715"]http://codeigniter.com/wiki/Native_session/[/quote]

Maybe someday I will use something like this.
#7

[eluser]WanWizard[/eluser]
[quote author="skunkbad" date="1275951183"]$_SESSION (by default) destroying itself on browser close is just one example.
Why try to improve something that works perfectly?[/quote]
Depends on your definition of perfectly.

I personally can't appreciate it when a server makes decisions for me. And I have plenty of examples where destroying the session on browser close is not a good idea...

With the session library I can decide (or in this case the admin of our CMS) when to have the session expire.
#8

[eluser]skunkbad[/eluser]
[quote author="WanWizard" date="1275952952"][quote author="skunkbad" date="1275951183"]$_SESSION (by default) destroying itself on browser close is just one example.
Why try to improve something that works perfectly?[/quote]
Depends on your definition of perfectly.

I personally can't appreciate it when a server makes decisions for me. And I have plenty of examples where destroying the session on browser close is not a good idea...

With the session library I can decide (or in this case the admin of our CMS) when to have the session expire.[/quote]

If you want to have $_SESSION extended past browser close, you simply use session_set_cookie_params(). The server never makes decisions for you, and this session_set_cookie_params() function allows for a persistent cookie! Yay for $_SESSION!
#9

[eluser]nuwanda[/eluser]
Yes, if setting the CI session duration to 0 killed the session on browser close, it would be perfect.
#10

[eluser]skunkbad[/eluser]
[quote author="nuwanda" date="1275968015"]Yes, if setting the CI session duration to 0 killed the session on browser close, it would be perfect.[/quote]

I don't know... I still like my session data to live on the server, and CI's session data lives in the browser. This can result in behavior that is different depending on usage.




Theme © iAndrew 2016 - Forum software by © MyBB