Hello All,

I'm having an issue pretty much exactly like the issue posted here:
http://www.nabble.com/Sessions,-redirects-and-setFlash-td14792737.html

Basically I set a session variable when an admin logs in with some info
$this->Session->write('AdminInfo', $admin);

And then on every page in the admin area I check if that session variable
is still valid or if it's expired using:

public function beforeFilter()
{
        $this->checkLogin();
}

public function checkLogin()
{
        if ($this->Session->check('AdminInfo') === false)
        {
                // Save the URL of where you want to go.
                $this->Session->setFlash('You must login to view this area.');
                $this->Session->write('RedirectURL', Router::url('', false));
                $this->redirect('/admin/login/');
        }
}

Now the problem is that after the redirect back to the login screen
all my session info is gone.  Neither the RedirectURL nor the setFlash
message exist upon returning to the login page.  All I see in the
session is the userAgent, rand, timeout, etc.

This only happens if the session existed beforehand and not when you
try to go to a page fresh before every logging in.  As a flow example:

1. Not Logged In - Go to admin area page - Redirect to login - Redirect URL
and setFlash both work

2. Logged In - Go to admin area page - session has timed out - Redirect to
login - Redirect URL and setFlash both gone now.

At no point in my code do I ever delete the session variables or sesion
itself.  This is only happening when the session times out on its own.

Does anyone have a solution or know whats going on here?  I've spent
hours trying to figure this out and the thread above didn't really offer
a solution since I don't use the DAuth component.

Any help would be greatly appreciated.

Thanks.



-- 
View this message in context: 
http://www.nabble.com/Session---setFlash---redirect---GONE%21-tp21485684p21485684.html
Sent from the CakePHP mailing list archive at Nabble.com.


--~--~---------~--~----~------------~-------~--~----~
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