You should always check if an session variable is null or not.

the string conversion does not fail because a string can be null. A float can't.

Debug the following and check the results
Code:
      object myobject = null;
      string s = (string)myobject;
      float f = (float)myobject;
'myobject' is bassically the same as the Session. The Session will return an object.

Anyway, 's' will be null and an error will occur on the float line..