Please sign in to comment.
Make stash() use clone of sql class (#4499)
* Make stash() use clone of sql class When using `stash()` while the query builder is not finished with an sql, there would either be errors or false results since the Session class uses the singleton Gdn::sql(). The `stash()` method (and its helper method `_getStashSession()`) are the only two methods using db queries in Session. So I've not set $this->sql in `__construct()` but only in `stash()` since it wouldn't be needed elsewhere. This solves issue #4391 * Make $sql protected, clone only once * Update class.session.php * Clone sql object in stash() and pass it to sub procedures Several additional changes: 1. removed dash from private method name 2. added documentation to getStashSession() 3. changed casening of variables in getStashSession() 4. changed array syntax from array() to  in getStashSession() 5. replaced serialize($session->Attributes) in stash() with dbencode(...) * Correct variable $domain case * Remove $valueToStash set to '' as default
- Loading branch information...