Just is left the domain.
It does not work with localhost, hopefully it will with the production's domain.
success_signout_url: @sf_guard_signin # used by BasesfGuardAuthActions.class.php. After logout we are redirected to this page
signin_url_path: login # used by sfGuardRememberMeFilter.class.php. The Remember cookie must not be used when using the login page
remember_cookie_path: /companyfront.php # used by sfGuardSecurityUser.class.php. The scope of the Remeber cookie
+ remember_cookie_domain: .localhost
level: err
loggers: ~
+ storage:
+ class: sfSessionStorage
+ param:
+ session_name: mobicompany
+ session_cookie_path: /companyfront.php
+ session_cookie_lifetime: 0 # The cookie will be deleted in the browser when it is closed
+
test:
storage:
class: sfSessionTestStorage
# http://www.symfony-project.org/reference/1_4/en/12-Filters
rendering: ~
+remember_me:
+ class: sfGuardRememberMeFilter
security: ~
# insert your own filters here
# default rules
homepage:
- url: /
- param: { module: default, action: index }
+ url: /
+ class: sfDoctrineRoute
+ param: { module: office, action: index }
+ options: { model: Office, type: object }
office_index:
url: /office/index
prod:
.settings:
- no_script_name: true
+ no_script_name: false
logging_enabled: false
dev:
{
$cookieName = sfConfig::get('app_sf_guard_plugin_remember_cookie_name', 'sfRemember');
+ $currentPath = trim($this->context->getRequest()->getPathInfo(), "/");
+ $loginPath = sfConfig::get('app_sf_guard_plugin_signin_url_path');
+
if (
$this->isFirstCall()
&&
$this->context->getUser()->isAnonymous()
&&
+ (strcmp($currentPath, $loginPath)!=0)
+ &&
$cookie = $this->context->getRequest()->getCookie($cookieName)
)
{
// make key as a cookie
$remember_cookie = sfConfig::get('app_sf_guard_plugin_remember_cookie_name', 'sfRemember');
- sfContext::getInstance()->getResponse()->setCookie($remember_cookie, $key, time() + $expiration_age);
+
+ //My remember cookie MUST depend on the path and in the future it will on the domain as well.
+ //FIXME: WHEN HAVING A DOMAIN TO ADD IT HERE AS WELL!!!!
+ // AND THE CONFIGURATION PARAMETER ON /config/app.yml!!!!
+ $path = sfConfig::get('app_sf_guard_plugin_remember_cookie_path', '/');
+ sfContext::getInstance()->getResponse()->setCookie($remember_cookie, $key, time() + $expiration_age, $path);
}
}
$this->setAuthenticated(false);
$expiration_age = sfConfig::get('app_sf_guard_plugin_remember_key_expiration_age', 15 * 24 * 3600);
$remember_cookie = sfConfig::get('app_sf_guard_plugin_remember_cookie_name', 'sfRemember');
- sfContext::getInstance()->getResponse()->setCookie($remember_cookie, '', time() - $expiration_age);
+
+ //My remember cookie MUST depend on the path and in the future it will on the domain as well.
+ //FIXME: WHEN HAVING A DOMAIN TO ADD IT HERE AS WELL!!!!
+ // AND THE CONFIGURATION PARAMETER ON /config/app.yml!!!!
+ $path = sfConfig::get('app_sf_guard_plugin_remember_cookie_path', '/');
+ sfContext::getInstance()->getResponse()->setCookie($remember_cookie, '', time() - $expiration_age, $path);
}
/**
return $this->redirect('' != $signinUrl ? $signinUrl : '@homepage');
}
}
- else
- {
- if ($request->isXmlHttpRequest())
- {
- $this->getResponse()->setHeaderOnly(true);
- $this->getResponse()->setStatusCode(401);
+ // I do not understand this stuff. Anyway, for me login just works with POST, so... why do I need this code?
+ //else
+ //{
+ // if ($request->isXmlHttpRequest())
+ // {
+ // $this->getResponse()->setHeaderOnly(true);
+ // $this->getResponse()->setStatusCode(401);
- return sfView::NONE;
- }
+ // return sfView::NONE;
+ // }
// if we have been forwarded, then the referer is the current URL
// if not, this is the referer of the current request
- $user->setReferer($this->getContext()->getActionStack()->getSize() > 1 ? $request->getUri() : $request->getReferer());
+ // $user->setReferer($this->getContext()->getActionStack()->getSize() > 1 ? $request->getUri() : $request->getReferer());
- $module = sfConfig::get('sf_login_module');
- if ($this->getModuleName() != $module)
- {
- return $this->redirect($module.'/'.sfConfig::get('sf_login_action'));
- }
+ // $module = sfConfig::get('sf_login_module');
+ // if ($this->getModuleName() != $module)
+ // {
+ // return $this->redirect($module.'/'.sfConfig::get('sf_login_action'));
+ // }
- $this->getResponse()->setStatusCode(401);
- }
+ // $this->getResponse()->setStatusCode(401);
+ //}
}
public function executeSignout($request)