Welcome Guest, Not a member yet? Register   Sign In
DB_Session not working! CI 2.0.2
#11

[eluser]danmontgomery[/eluser]
CI sessions use cookies, not native php sessions. This is covered in the user guide.
#12

[eluser]Asiansexynine[/eluser]
[quote author="noctrum" date="1307398555"]CI sessions use cookies, not native php sessions. This is covered in the user guide.[/quote]

What about web browser are setting disable cookie? CI session still working? I am test website on my localhost. and not sure about CI Session work? if disable cookies on web browser..

can't change CI Session to session.save_path to use native php sessions? need to store session on server not need to store session on client web browser..

if use DB session maybe need to run cronjobs to deleted expire session also.. then better to save session as file to session.save_path
#13

[eluser]WanWizard[/eluser]
The session_id is not part of the userdata, you can not retrieve it.

If you load the session library, a session is established automatically, but as it's new, it's empty.

Try this in your controller:
Code:
if ( $test = $this->session->userdata('test') )
{
    echo "Session found, value stored was: ",$test;
    $this->session->unset_userdata('test');
}
else
{
    echo "Empty session, setting a test variable";
    $this->session->set_userdata('test', 'value');
}

and load the page a few times to see the effect.
#14

[eluser]Asiansexynine[/eluser]
[quote author="WanWizard" date="1307404940"]The session_id is not part of the userdata, you can not retrieve it.

If you load the session library, a session is established automatically, but as it's new, it's empty.

Try this in your controller:
Code:
if ( $test = $this->session->userdata('test') )
{
    echo "Session found, value stored was: ",$test;
    $this->session->unset_userdata('test');
}
else
{
    echo "Empty session, setting a test variable";
    $this->session->set_userdata('test', 'value');
}

and load the page a few times to see the effect.[/quote]

your code that just check php session are working or not? yes it work.. by test.. but how to store php session files on local server? I don't need to store session cookie on clients web browser.. because may not work with web browser were disable cookies..

it's possible to change setting?
#15

[eluser]InsiteFX[/eluser]
If the user disables their cookies there is nothing you can do about it!
Also you cannot have sessions without cookies, the cookie stores the session_id!

I think you need to goto php.net and read up on sessions!

InsiteFX
#16

[eluser]Asiansexynine[/eluser]
[quote author="InsiteFX" date="1307412070"]If the user disables their cookies there is nothing you can do about it!
Also you cannot have sessions without cookies, the cookie stores the session_id!

I think you need to goto php.net and read up on sessions!

InsiteFX[/quote]

if you read CI docs you will know that code below is check and show session_id from CI Session. it not PHP session manual...

Code:
<?php
$session_id = $this->session->userdata('session_id');

echo 'Session ID = ' . $session_id;
?>
#17

[eluser]InsiteFX[/eluser]
And if you read he session Class you will see that it creates a cookie!

InsiteFX
#18

[eluser]Asiansexynine[/eluser]
I am found another guys also looking for same as me from another post already




Theme © iAndrew 2016 - Forum software by © MyBB