Código PHP:
$this->getUser()->setAttribute('usuario', $usuario);
$this->getUser()->setAuthenticated(true);
Pongo el yml por si se necesita:
Código PHP:
# You can find more information about this file on the symfony website:
# http://www.symfony-project.org/reference/1_4/en/05-Factories
prod:
logger:
class: sfNoLogger
param:
level: err
loggers: ~
test:
storage:
class: sfSessionTestStorage
param:
session_path: %SF_TEST_CACHE_DIR%/sessions
response:
class: sfWebResponse
param:
send_http_headers: false
mailer:
param:
delivery_strategy: none
dev:
mailer:
param:
delivery_strategy: none
all:
routing:
class: sfPatternRouting
param:
generate_shortest_url: true
extra_parameters_as_query_string: true
view_cache_manager:
class: sfViewCacheManager
param:
cache_key_use_vary_headers: true
cache_key_use_host_name: true
user:
class: myUser
param:
timeout: 3600
storage:
class: sfSessionStorage
param:
session_name: agente