// Beego seems to insist on choosing it's own session ID, so we must accept a session ID here, although I don't fine this secure, since you could change someone's login to be pointed at your session information if you knew their session ID
Beego seems to insist on choosing it's own session ID, so we must accept a session ID here, although I don't fine this secure, since you could change someone's login to be pointed at your session information if you knew their session ID
// Beego seems to insist on choosing it ' s own session ID so we must accept a session ID here although I don ' t fine this secure since you could change someone ' s login to be pointed at your session information if you knew their session ID
func (s *CGISession) New(sessionId ...string) (ss *SessionStore) {
	s.Driver()
	if len(sessionId) > 0 {
		var newSessionId string
		if len(sessionId) == 2 {
			newSessionId = sessionId[1]
		} else {
			newSessionId = sessionId[0]
		}
		ss = s.Load(sessionId[0])
		if ss == nil {
			ss = s.createSession(newSessionId)
		} else {
			if newSessionId != sessionId[0] {
				s.deleteSession(sessionId[0])
				ss.sessionId = newSessionId
				now := time.Now().Unix()
				ss.ParamInt64("_SESSION_CTIME", now)
				ss.ParamInt64("_SESSION_ATIME", now)
				ss.ParamInt64("_SESSION_ETIME", s.config.ExpireSeconds)
				ss.Flush()
			}
		}
	} else {
		ss = s.createSession()
	}
	return ss
}
func ( s * CGISession ) New ( sessionId ... string ) ( ss * SessionStore ) { s . Driver ( ) if len ( sessionId ) > 0 { var newSessionId string if len ( sessionId ) == 2 { newSessionId = sessionId [ 1 ] } else { newSessionId = sessionId [ 0 ] } ss = s . Load ( sessionId [ 0 ] ) if ss == nil { ss = s . createSession ( newSessionId ) } else { if newSessionId != sessionId [ 0 ] { s . deleteSession ( sessionId [ 0 ] ) ss . sessionId = newSessionId now := time . Now ( ) . Unix ( ) ss . ParamInt64 ( " " , now ) ss . ParamInt64 ( " " , now ) ss . ParamInt64 ( " " , s . config . ExpireSeconds ) ss . Flush ( ) } } } else { ss = s . createSession ( ) } return ss }
Beego seems to insist on choosing it's own session ID, so we must accept a session ID here, although I don't fine this secure, since you could change someone's login to be pointed at your session information if you knew their session ID
Beego seems to insist on choosing it ' s own session ID so we must accept a session ID here although I don ' t fine this secure since you could change someone ' s login to be pointed at your session information if you knew their session ID
// Replace session with new session ID