I am having trouble with a session variable returning favicon.ico
instead of the value I set it to.

Here's the method from my controller:

function login( $ref = null )
    {
        if( !empty( $ref ) )
        {
                $this->Session->write('admin_referer', urldecode( $ref ) );

        }
        echo 'ref: ' .$this->Session->read( 'admin_referer' ); // for
testing
        $this->set('error', false);
        if( !empty( $this->data ) )
        {
            if( $this->data['Admin']['username'] == $this->username &&
$this->data['Admin']['password'] == $this->pw )
            {
                $this->Session->write( 'admin', true );
                if( $this->Session->check( 'admin_referer' ) )
                {
                        $location = $this->Session->read( 'admin_referer' );
                        //$location = 'test';
                        $this->Session->delete( 'admin_referer' );
                }
                else
                        $location = '/';

                $this->flash( 'You are now logged in as
administrator', $location );

            }
            else
                $this->set( 'error', true );
        }
    }

And my view:

<?= !empty( $error ) ? '<p>Login failed. Please try again.</p>' : ''; ?
>
<form action="<?= $html->url('/admin/login') ?>" method="post">
<fieldset>
<legend>Administrator Login</legend>
<label for="username">Username</label>
<?= $html->input('Admin/username', array('size' => 10) ); ?><br />
<br />
<label for="password">Password</label>
<?= $html->input('Admin/password', array('size' => 10) ); ?><br />
<br />
<?= $html->submit('Log In'); ?>
</fieldset>
</form>

Any idea what's going on?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to