Er...
Sorry, you're right.
My code example was wrong, but using <?php $this->Session->check
('key') ?> it also returns false. It creates two sessions (entries) in
the database (cake_sessions).

What i'm doing exactly:

1. User comes from an external site (eg. google.com) to an user-
protected page (eg. mydomain.com/post/add) (user must login to access
the page)
2. Cakephp stores the page the user wants to access in the session
3. User is redirected <?php $this->redirect('/users/login'); ?>
4. User authenticates and returns to <?php $this->Session->read
('referer'); ?> (note: if using <?php $this->referer() ?> in this
case, it returns the original off-site address (google.com), not the
first address the user tried to reach (mydomain.com/post/add)).

Still need help. Please?

Thanks!

On Aug 11, 11:52 am, Robert P <shiftyrobs...@gmail.com> wrote:
> In TwoController::bug() your call to SessionComponent seems
> nonsensical. Looking at what you are trying to do it should either be
>
> $this->Session->check('key') which should return TRUE since you set
> this value in OneController::start(), or
>
> ($this->Session->read('key') == 'info') which should also return TRUE
> for the above reason
>
> On Aug 11, 10:06 pm, LS <lsmo...@gmail.com> wrote:
>
> > Hello, everyone.
>
> > I'm into a dead end and I can't seem to get this session and redirect
> > things right...
>
> > I've tested this using cakephp, php and database session methods.
>
> > I have two controllers and one action in each one, like this:
>
> > <?php
>
> > class OneController extends AppController {
> >   function start() {
> >     $this->Session->write('key', 'info');
> >     $this->redirect('/two/bug');
> >     // exit; // <<-- with or without this, I get the error.
> >   }
> > (...)
> > ?>
>
> > other file
> > <?php
>
> > class TwoController extends AppController {
> >   function bug() {
> >     if ($this->Session->check('info')) {
> >       // This never happens!
> >       echo("working");
> >     }
> >   }
>
> > }
>
> > ?>
>
> > When I check the database, I see two sessions, one with the info that
> > was written on the controller "one", and another one almost empty
> > (only timeout and other info).
>
> > I've even set the <?php Configure::write('Session.checkAgent',
> > false); ?> on the core.php file, but it still no good.
>
> > Can someone enlight me, please?
> > Thanks!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to