From e822642cb0f0532224b1ceded69e5b90490d38c3 Mon Sep 17 00:00:00 2001 From: Pengfei Xue Date: Thu, 13 Feb 2014 18:24:05 +0800 Subject: [PATCH 1/2] fix bug, can not remove session file --- session/sess_file.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/session/sess_file.go b/session/sess_file.go index 73eec874..ad91726b 100644 --- a/session/sess_file.go +++ b/session/sess_file.go @@ -143,7 +143,7 @@ func (fp *FileProvider) SessionExist(sid string) bool { // Remove all files in this save path func (fp *FileProvider) SessionDestroy(sid string) error { - os.Remove(path.Join(fp.savePath)) + os.Remove(path.Join(fp.savePath, string(sid[0]), string(sid[1]), sid)) return nil } From 05a0a4b046ef2ee0d8b8d75b2ebe94a03834d4db Mon Sep 17 00:00:00 2001 From: Pengfei Xue Date: Fri, 14 Feb 2014 17:52:57 +0800 Subject: [PATCH 2/2] register interface to gob automatically --- cache/file.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cache/file.go b/cache/file.go index 410da3a0..d750fecc 100644 --- a/cache/file.go +++ b/cache/file.go @@ -147,6 +147,8 @@ func (this *FileCache) Get(key string) interface{} { // timeout means how long to keep this file, unit of ms. // if timeout equals FileCacheEmbedExpiry(default is 0), cache this item forever. func (this *FileCache) Put(key string, val interface{}, timeout int64) error { + gob.Register(val) + filename := this.getCacheFileName(key) var item FileCacheItem item.Data = val