-1

I want use the class PersistentTokenBasedRememberMeServices or my custom class for delivery the remember me token but I dont know how to configure it into Silex 2.

How can I do ?

Thanks in advance.

EDIT : I know the default remember me configuration and work fine. But, I need custom this default behavior for implement more security check.

  • Have you tried following the [documentation](http://silex.sensiolabs.org/doc/2.0/providers/remember_me.html) or tried anything at all that you can add to the question? – lsouza Feb 23 '17 at 06:36
  • Thanks, I know the default remember me configuration and work fine. But, I need custom this default behavior for implement more security check. – Jean-Baptiste N. Feb 23 '17 at 06:51

2 Answers2

1

you can used the RememberMeServiceProvider: http://silex.sensiolabs.org/doc/providers/remember_me.html

i hope this what you search about her :)

  • Thanks, I already use it. But The default behavior is too insecure in my context. The default behavior store all information on user into the cookie. But I want store a key into the cookie and the username into my database. I can reset all remembered information by flush the table into my database. This is only one use case wanted. – Jean-Baptiste N. Feb 24 '17 at 15:44
  • Now I'm realizing my graduation project with Silex and i new developer :p . but this if you want set your cookie : public function testSetCookie( $value) { $cookie = new Cookie('key'', $value); $response = new Response(); $response->headers->setCookie($cookie); } public function testGetCookie(Request $request) { $cookies = $request->cookies; if ($cookies->has('key')) { var_dump($cookies->get('key')); } } – Ahmed Oumezzine Feb 25 '17 at 14:52
0

This is not descibed in the documentation :

For load a custom remberme service, I have define the service manually with name : "security.remember_me.service.".

Now I have my custom behavior.