Default session removal cookie path to '/'.

Fixes #295.
This commit is contained in:
Sergio Benitez 2017-05-19 03:46:19 -07:00
parent 9b955747e4
commit 4cab891fda
1 changed files with 5 additions and 1 deletions

View File

@ -60,7 +60,11 @@ impl<'a> Session<'a> {
self.cookies.get_mut().private(&self.key).add(cookie)
}
pub fn remove(&mut self, cookie: Cookie<'static>) {
pub fn remove(&mut self, mut cookie: Cookie<'static>) {
if cookie.path().is_none() {
cookie.set_path("/");
}
self.cookies.get_mut().private(&self.key).remove(cookie)
}