Bug when saving sessions
3 posts
• Page 1 of 1
Bug when saving sessions
This occurs with the latest SVN version:
- Code: Select all
System.Runtime.Serialization.SerializationException: Type PHP.Core.PhpString is not marked as Serializable.
at System.Runtime.Serialization.Formatters.Binary.BinaryCommon.CheckSerializable (System.Type type, ISurrogateSelector selector, StreamingContext context) [0x0002c] in /opt/imatronix/src/mono-2.10.9/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/BinaryCommon.cs:119
at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.GetObjectData (System.Object obj, System.Runtime.Serialization.Formatters.Binary.TypeMetadata& metadata, System.Object& data) [0x0008e] in /opt/imatronix/src/mono-2.10.9/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/ObjectWriter.cs:406
at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteObject (System.IO.BinaryWriter writer, Int64 id, System.Object obj) [0x00000] in /opt/imatronix/src/mono-2.10.9/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/ObjectWriter.cs:316
at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteObjectInstance (System.IO.BinaryWriter writer, System.Object obj, Boolean isValueObject) [0x00062] in /opt/imatronix/src/mono-2.10.9/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/ObjectWriter.cs:303
at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteQueuedObjects (System.IO.BinaryWriter writer) [0x00005] in /opt/imatronix/src/mono-2.10.9/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/ObjectWriter.cs:281
at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteObjectGraph (System.IO.BinaryWriter writer, System.Object obj, System.Runtime.Remoting.Messaging.Header[] headers) [0x0001f] in /opt/imatronix/src/mono-2.10.9/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/ObjectWriter.cs:268
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize (System.IO.Stream serializationStream, System.Object graph, System.Runtime.Remoting.Messaging.Header[] headers) [0x0005f] in /opt/imatronix/src/mono-2.10.9/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/BinaryFormatter.cs:218
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize (System.IO.Stream serializationStream, System.Object graph) [0x00000] in /opt/imatronix/src/mono-2.10.9/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/BinaryFormatter.cs:197
at PHP.Core.AspNetSessionHandler.Persist (PHP.Core.PhpArray variables, PHP.Core.ScriptContext context, System.Web.HttpContext httpContext) [0x00000] in <filename unknown>:0
at PHP.Core.RequestContext.EndSession (Boolean abandon) [0x00000] in <filename unknown>:0
at PHP.Core.RequestContext.<TryDisposeBeforeFinalization>b__0 (System.Object _) [0x00000] in <filename unknown>:0
at PHP.Core.ScriptContext.GuardedCall[Object,Object] (System.Converter`2 routine, System.Object data, Boolean allowUserExceptions) [0x00000] in <filename unknown>:0
- kripper
- Posts: 44
- Joined: February 19th, 2012, 1:02 am
Re: Bug when saving sessions
PhpString was not marked as serializable. Will be fixed in upcoming release.
Jakub Misek │ DEVSENSE s.r.o. | @misekjakub │ jakub@devsense.com │
-
Jakub Misek - Posts: 2092
- Joined: January 4th, 2012, 2:42 pm
- Location: Prague
Re: Bug when saving sessions
Ok. Thanks.
I'm providing a test case:
Note that the serialization problem only occurs when using the ASP.NET StateHandler.
I'm providing a test case:
- Code: Select all
// Doesn't work
$test = '';
$test .= 'ok';
$_SESSION['test'] = $test;
- Code: Select all
// Works
$test2 = '';
$test2 .= 'ok';
$test2 = '' . $test2; // Probably this converts the PhpString (not serializable) to something else (serializable)
$_SESSION['test2'] = $test2;
Note that the serialization problem only occurs when using the ASP.NET StateHandler.
- kripper
- Posts: 44
- Joined: February 19th, 2012, 1:02 am
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 19 guests