Subversion Repositories SmartDukaan

Rev

Rev 11411 | Rev 11537 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 11411 Rev 11419
Line 169... Line 169...
169
 
169
 
170
		// Is the session data we unserialized an array with the correct format?
170
		// Is the session data we unserialized an array with the correct format?
171
		if ( ! is_array($session) OR ! isset($session['session_id']) OR ! isset($session['ip_address']) OR ! isset($session['user_agent']) OR ! isset($session['last_activity']))
171
		if ( ! is_array($session) OR ! isset($session['session_id']) OR ! isset($session['ip_address']) OR ! isset($session['user_agent']) OR ! isset($session['last_activity']))
172
		{
172
		{
173
			//$this->sess_destroy();
173
			//$this->sess_destroy();
174
			return FALSE;
174
			//return FALSE;
175
		}
175
		}
176
 
176
 
177
		// Is the session current?
177
		// Is the session current?
178
		if (($session['last_activity'] + $this->sess_expiration) < $this->now)
178
		if (($session['last_activity'] + $this->sess_expiration) < $this->now)
179
		{
179
		{
Line 183... Line 183...
183
 
183
 
184
		// Does the IP Match?
184
		// Does the IP Match?
185
		if ($this->sess_match_ip == TRUE AND $session['ip_address'] != $this->CI->input->ip_address())
185
		if ($this->sess_match_ip == TRUE AND $session['ip_address'] != $this->CI->input->ip_address())
186
		{
186
		{
187
			//$this->sess_destroy();
187
			//$this->sess_destroy();
188
			return FALSE;
188
			//return FALSE;
189
		}
189
		}
190
 
190
 
191
		// Does the User Agent Match?
191
		// Does the User Agent Match?
192
		if ($this->sess_match_useragent == TRUE AND trim($session['user_agent']) != trim(substr($this->CI->input->user_agent(), 0, 120)))
192
		if ($this->sess_match_useragent == TRUE AND trim($session['user_agent']) != trim(substr($this->CI->input->user_agent(), 0, 120)))
193
		{
193
		{
194
			//$this->sess_destroy();
194
			//$this->sess_destroy();
195
			return FALSE;
195
			//return FALSE;
196
		}
196
		}
197
 
197
 
198
		// Is there a corresponding session in the DB?
198
		// Is there a corresponding session in the DB?
199
		if ($this->sess_use_database === TRUE)
199
		if ($this->sess_use_database === TRUE)
200
		{
200
		{
Line 214... Line 214...
214
 
214
 
215
			// No result?  Kill it!
215
			// No result?  Kill it!
216
			if ($query->num_rows() == 0)
216
			if ($query->num_rows() == 0)
217
			{
217
			{
218
				//$this->sess_destroy();
218
				//$this->sess_destroy();
219
				return FALSE;
219
				//return FALSE;
220
			}
220
			}
221
 
221
 
222
			// Is there custom data?  If so, add it to the main session array
222
			// Is there custom data?  If so, add it to the main session array
223
			$row = $query->row();
223
			$row = $query->row();
224
			if (isset($row->user_data) AND $row->user_data != '')
224
			if (isset($row->user_data) AND $row->user_data != '')