views:

65

answers:

1

Hey!

So I'm basically unable to use any kind of session in my Kohana 3 project. A few example of the issue :

$session = Session::instance();
$session->set('customer_id', $customer->id);
$this->request->redirect('controller/action');
//At the start of the redirected action
$session = Session::instance();
$customer_id = $session->get('customer_id');

$customer_id, in the session, has a positive value before the redirect, after it has a value of 0. I also tried with the basic PHP session - which may be disabled in Kohana - I don't know. Didn't thought so, since we can still use $_GET and $_POST.

session_start();
$_SESSION['customer_id'] = $customer->id;
//At the start of the redirected action
session_start();
$customer_id = $_SESSION['customer_id'];

Same scenario as before, except that now the $customer_id, after the redirect, is null.

Not sure what to try right now, I did make sure Sessions were enable in php.ini (I have quite a bunch of others application, under other framework or CMS, currently installed, and I'm convinced at least one of them use sessions). Currently I'm looking into this : http://forum.kohanaframework.org/discussion/3018/using-native-session-array/p1 , though I doubt it's the issue here.

A: 

Not sure what I was thinking when I was testing this - but I resolved this. I'd have to guess the issue here was my own profound stupidity.

Afrosimon
Can you mark this as solved and provide your answer.
The Pixel Developer
In the end my code was correct, the error was completely unrelated to the sessions.
Afrosimon