ooo! I fixed it on my own!
var person User
// Check if the variable exists in the session
if _, ok := session.Values["User"]; ok {
// The variable exists in the session
fmt.Println("User variable exists in session")
person = session.Values["User"].(User)
} else {
// The variable does not exist in the session
fmt.Println("User variable absent from session")
}