2 // System.Web.SessionState.SessionConfig
5 // Gonzalo Paniagua Javier (gonzalo@ximian.com)
7 // (C) 2003 Ximian, Inc (http://www.ximian.com)
8 // Copyright (C) 2005-2006 Novell, Inc (http://www.novell.com)
10 // Permission is hereby granted, free of charge, to any person obtaining
11 // a copy of this software and associated documentation files (the
12 // "Software"), to deal in the Software without restriction, including
13 // without limitation the rights to use, copy, modify, merge, publish,
14 // distribute, sublicense, and/or sell copies of the Software, and to
15 // permit persons to whom the Software is furnished to do so, subject to
16 // the following conditions:
18 // The above copyright notice and this permission notice shall be
19 // included in all copies or substantial portions of the Software.
21 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
24 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
25 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
26 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
27 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
30 namespace System.Web.SessionState
34 internal SessionStateMode Mode;
35 internal int Timeout; // minutes
36 internal bool CookieLess;
37 internal string StateConnectionString;
38 internal string SqlConnectionString;
39 internal string StateNetworkTimeout;
41 public SessionConfig (object parent)
43 SessionConfig p = (parent as SessionConfig);
45 CookieLess = p.CookieLess;
48 StateConnectionString = p.StateConnectionString;
49 SqlConnectionString = p.SqlConnectionString;
51 Mode = SessionStateMode.InProc;
53 StateConnectionString = "127.0.0.1:42424";
54 SqlConnectionString = "user id=sa;password=;data source=127.0.0.1";
58 internal bool SetMode (string value)
61 Mode = (SessionStateMode) Enum.Parse (typeof (SessionStateMode), value, true);
69 internal bool SetCookieLess (string value)
74 CookieLess = (0 == String.Compare ("true", value, true));
75 if (!CookieLess && String.Compare ("false", value, true) != 0)
81 internal bool SetTimeout (string value)
84 Timeout = Int32.Parse (value);
92 internal void SetStateConnectionString (string value)
94 StateConnectionString = value;
97 internal void SetSqlConnectionString (string value)
99 SqlConnectionString = value;
102 internal void SetStateNetworkTimeout (string value)
104 StateNetworkTimeout = value;