|
View:
New views
5 Messages
—
Rating Filter:
Alert me
|
|
|
sessions problem?
by Mikhail Pauw
::
Rate this Message:
Reply (Restricted by the Administrator) | Reply to Author | View Threaded | Show Only this Message Hello, I’m pretty new to Fluorine and I run into a problem
that I can’t understand. I have a big background in Flex+PHP+Linux, but
my current position I have to work with Flex+ASP.NET+Windows, so I have two new
components to figure out. I started out with the examples that come with Fluorine. I build
forward on MultipleClientAuthentication. I’ve modified the SecureService
class a bit (source below) and the flex part (doesn’t need any extra explanation).
When I run the project on 2 different machines and I set the SecureData on one
of them and on the other machine I do get SecureData the function returns the
value that was set by machine1. What I expected that It would return me the
default value. So what appears to me is that Fluorine doesn’t create
a separate session for every client that uses the app. But I need it to work
like that. I hope someone can help me a bit forward with my
understanding of Fluorine. Thanks in advance, Mikhail using System; using FluorineFx; namespace ServiceLibrary { /// <summary> /// Summary description for SecureService /// </summary> [RemotingService()] public class SecureService { private static
string _value = "default value"; public
SecureService() { } public string
GetSecureData() {
return _value; } public string
SetSecureData(string value) {
_value = value;
return value; } } } Tel:
+31 (0)343 529 529 Fax:
+31 (0)343 529 530 Yucat mobile business solutions Postbus 208 • 3970 AE Driebergen Hoofdstraat 248 • 3972 LK Driebergen Disclaimer The information transmitted is
intended only for the person or entity to which it is addressed and may contain
confidential and/or privileged material. Any review, retransmission,
dissemination or other use of, or taking of any action in reliance upon, this
information by persons or entities other than the intended recipient is
prohibited. If you received this in error, please contact the sender and delete
the material from any computer. _______________________________________________ fluorine mailing list fluorine@... http://fluorine.thesilentgroup.com/mailman/listinfo/fluorine_fluorine.thesilentgroup.com |
|
|
Re: sessions problem?
by Support-179
::
Rate this Message:
Reply (Restricted by the Administrator) | Reply to Author | View Threaded | Show Only this Message Hi Mikhail,
you defined a static ("global"/shared) _value member in
your service. So any client connecting to the service will see the global value
of this member (if client1 sets "some value" then everybody will get that
value).
Static variables are not equivalent of "session variables",
they are shared between all objects in the application
domain.
Furthermore Session management is performed by the asp.net
runtime and not the gateway. However from a service you have access to session
variables via HttpContext(http://msdn2.microsoft.com/en-us/library/system.web.httpcontext.session.aspx)
.... or the equivalent FluorineContext.Current.Session (so if you want to keep
session data for the client then keep it in that dictionary and not in a class
member).
Additionally services can have "session" scope (as defined
in the Flex configuration files) which means that each client will get it's own
service object so member variables (not declared static) will "act" as session
variables. This case however is not recommended for any
scenario.
There is a Flash sample illustrating this concept in the
[FluorineFx Installdir]\Samples\Flash\Remoting\Activation folder (it does
configure service scope by using Flex service config files)
Zoli From: fluorine-bounces@... [mailto:fluorine-bounces@...] On Behalf Of Mikhail Pauw Sent: Wednesday, April 09, 2008 6:05 PM To: fluorine@... Subject: [Fluorine] sessions problem? Hello, I’m pretty new to Fluorine and I run into a problem that I
can’t understand. I have a big background in Flex+PHP+Linux, but my current
position I have to work with Flex+ASP.NET+Windows, so I have two new components
to figure out. I started out with the examples that come with Fluorine. I
build forward on MultipleClientAuthentication. I’ve modified the SecureService
class a bit (source below) and the flex part (doesn’t need any extra
explanation). When I run the project on 2 different machines and I set the
SecureData on one of them and on the other machine I do get SecureData the
function returns the value that was set by machine1. What I expected that It
would return me the default value. So what appears to me is that Fluorine doesn’t create a
separate session for every client that uses the app. But I need it to work like
that. I hope someone can help me a bit forward with my
understanding of Fluorine. Thanks in advance, Mikhail using System; using FluorineFx; namespace ServiceLibrary { /// <summary> /// Summary description for
SecureService /// </summary> [RemotingService()] public class SecureService { private static
string _value = "default value"; public
SecureService() { } public string
GetSecureData() {
return _value; } public string
SetSecureData(string value) {
_value = value;
return value; } } } Tel: +31 (0)343 529
529 Fax: +31 (0)343 529
530 Yucat
mobile business solutions Postbus
208 • 3970 AE Driebergen Hoofdstraat
248 • 3972 LK Driebergen Disclaimer
The
information transmitted is intended only for the person or entity to which it is
addressed and may contain confidential and/or privileged material. Any review,
retransmission, dissemination or other use of, or taking of any action in
reliance upon, this information by persons or entities other than the intended
recipient is prohibited. If you received this in error, please contact the
sender and delete the material from any computer. _______________________________________________ fluorine mailing list fluorine@... http://fluorine.thesilentgroup.com/mailman/listinfo/fluorine_fluorine.thesilentgroup.com |
|
|
Re: sessions problem?
by Adam Schaible-4
::
Rate this Message:
Reply (Restricted by the Administrator) | Reply to Author | View Threaded | Show Only this Message Thanks for this answer… I
wasn’t experiencing this trouble, but the depth of your answer will help
me in the future. From: fluorine-bounces@...
[mailto:fluorine-bounces@...] On Behalf Of Support Hi Mikhail, you defined a static ("global"/shared) _value member in
your service. So any client connecting to the service will see the global value
of this member (if client1 sets "some value" then everybody will get
that value). Static variables are not equivalent of "session
variables", they are shared between all objects in the application domain. Furthermore Session management is performed by the asp.net runtime
and not the gateway. However from a service you have access to session
variables via HttpContext(http://msdn2.microsoft.com/en-us/library/system.web.httpcontext.session.aspx)
.... or the equivalent FluorineContext.Current.Session (so if you want to keep
session data for the client then keep it in that dictionary and not in a class
member). Additionally services can have "session" scope (as
defined in the Flex configuration files) which means that each client will get
it's own service object so member variables (not declared static) will
"act" as session variables. This case however is not recommended for
any scenario. There is a Flash sample illustrating this concept in the
[FluorineFx Installdir]\Samples\Flash\Remoting\Activation folder (it does
configure service scope by using Flex service config files) Zoli From:
fluorine-bounces@...
[mailto:fluorine-bounces@...] On Behalf Of Mikhail
Pauw Hello, I’m pretty new to Fluorine and I run into a problem
that I can’t understand. I have a big background in Flex+PHP+Linux, but
my current position I have to work with Flex+ASP.NET+Windows, so I have two new
components to figure out. I started out with the examples that come with Fluorine. I
build forward on MultipleClientAuthentication. I’ve modified the
SecureService class a bit (source below) and the flex part (doesn’t need
any extra explanation). When I run the project on 2 different machines and I
set the SecureData on one of them and on the other machine I do get SecureData
the function returns the value that was set by machine1. What I expected that
It would return me the default value. So what appears to me is that Fluorine doesn’t create
a separate session for every client that uses the app. But I need it to work
like that. I hope someone can help me a bit forward with my
understanding of Fluorine. Thanks in advance, Mikhail using System; using FluorineFx; namespace ServiceLibrary { /// <summary> /// Summary description for SecureService /// </summary> [RemotingService()] public class SecureService { private static
string _value = "default value"; public
SecureService() { } public string
GetSecureData() {
return _value; } public string
SetSecureData(string value) {
_value = value;
return value; } } } Tel:
+31 (0)343 529 529 Fax:
+31 (0)343 529 530 Yucat mobile business solutions Postbus 208 • 3970 AE Driebergen Hoofdstraat 248 • 3972 LK Driebergen Disclaimer The information transmitted is
intended only for the person or entity to which it is addressed and may contain
confidential and/or privileged material. Any review, retransmission,
dissemination or other use of, or taking of any action in reliance upon, this
information by persons or entities other than the intended recipient is
prohibited. If you received this in error, please contact the sender and delete
the material from any computer.
_______________________________________________ fluorine mailing list fluorine@... http://fluorine.thesilentgroup.com/mailman/listinfo/fluorine_fluorine.thesilentgroup.com |
|
|
Re: sessions problem?
by Mikhail Pauw
::
Rate this Message:
Reply (Restricted by the Administrator) | Reply to Author | View Threaded | Show Only this Message Hello Zoli, Thank you for your clarifying answer.
The behavior of a static in ASP.NET isn’t really what I expected. At
least now I know how to structure my code, so it behaves like I want. J Mikhail From:
fluorine-bounces@...
[mailto:fluorine-bounces@...] On Behalf Of Support Hi Mikhail, you defined a static ("global"/shared) _value member in
your service. So any client connecting to the service will see the global value
of this member (if client1 sets "some value" then everybody will get
that value). Static variables are not equivalent of "session
variables", they are shared between all objects in the application domain. Furthermore Session management is performed by the asp.net runtime
and not the gateway. However from a service you have access to session
variables via HttpContext(http://msdn2.microsoft.com/en-us/library/system.web.httpcontext.session.aspx)
.... or the equivalent FluorineContext.Current.Session (so if you want to keep
session data for the client then keep it in that dictionary and not in a class
member). Additionally services can have "session" scope (as defined
in the Flex configuration files) which means that each client will get it's own
service object so member variables (not declared static) will "act"
as session variables. This case however is not recommended for any scenario. There is a Flash sample illustrating this concept in the
[FluorineFx Installdir]\Samples\Flash\Remoting\Activation folder (it does
configure service scope by using Flex service config files) Zoli From: fluorine-bounces@...
[mailto:fluorine-bounces@...] On Behalf Of Mikhail
Pauw Hello, I’m pretty new to Fluorine and I run into a problem
that I can’t understand. I have a big background in Flex+PHP+Linux, but
my current position I have to work with Flex+ASP.NET+Windows, so I have two new
components to figure out. I started out with the examples that come with Fluorine. I
build forward on MultipleClientAuthentication. I’ve modified the
SecureService class a bit (source below) and the flex part (doesn’t need
any extra explanation). When I run the project on 2 different machines and I
set the SecureData on one of them and on the other machine I do get SecureData
the function returns the value that was set by machine1. What I expected that
It would return me the default value. So what appears to me is that Fluorine doesn’t create
a separate session for every client that uses the app. But I need it to work
like that. I hope someone can help me a bit forward with my
understanding of Fluorine. Thanks in advance, Mikhail using System; using FluorineFx; namespace ServiceLibrary { /// <summary> /// Summary description for SecureService /// </summary> [RemotingService()] public class SecureService { private static
string _value = "default value"; public
SecureService() { } public string GetSecureData() {
return _value; } public string
SetSecureData(string value) {
_value = value;
return value; } } } Tel:
+31 (0)343 529 529 Fax:
+31 (0)343 529 530 Yucat mobile business solutions Postbus 208 • 3970 AE Driebergen Hoofdstraat 248 • 3972 LK Driebergen Disclaimer The information transmitted is
intended only for the person or entity to which it is addressed and may contain
confidential and/or privileged material. Any review, retransmission,
dissemination or other use of, or taking of any action in reliance upon, this
information by persons or entities other than the intended recipient is
prohibited. If you received this in error, please contact the sender and delete
the material from any computer. _______________________________________________ fluorine mailing list fluorine@... http://fluorine.thesilentgroup.com/mailman/listinfo/fluorine_fluorine.thesilentgroup.com |
|
|
Re: sessions problem?
by Support-179
::
Rate this Message:
Reply (Restricted by the Administrator) | Reply to Author | View Threaded | Show Only this Message Hi Mikhail,
more specifically a static variable has one copy per
AppDomain in the .NET runtime. ASP.NET is just the framework built on .NET
(so static variables behave in ASP.NET as they behave in
.NET).
It is worth mentioning that the asp.net hosting process
(the process/exe started by IIS for example) will run multiple web applications
in the same process but in different application domains so if a library is
shared between 2 web applications each will have its own copy of the
variable.
Another important note: multiple requests processed by your
application will access your variable from multiple threads and you may need to
have synchronized access to static variables.
Lastly: session variables are just simple key-value pairs
stored and managed in a dictionary for each user session by asp.net. When using
session variables keep in mind that they are automatically discarded after they
are not used for the timeout setting that is specified in the Web.config
file.
Zoli From: fluorine-bounces@... [mailto:fluorine-bounces@...] On Behalf Of Mikhail Pauw Sent: Friday, April 11, 2008 12:35 AM To: Fluorine Mailing List Subject: Re: [Fluorine] sessions problem? Hello
Zoli, Thank you for your clarifying
answer. The behavior of a static in ASP.NET isn’t really what I expected. At
least now I know how to structure my code, so it behaves like I want.
J Mikhail From:
fluorine-bounces@...
[mailto:fluorine-bounces@...] On Behalf Of
Support Hi
Mikhail, you
defined a static ("global"/shared) _value member in your service. So any client
connecting to the service will see the global value of this member (if client1
sets "some value" then everybody will get that value). Static
variables are not equivalent of "session variables", they are shared between all
objects in the application domain. Furthermore
Session management is performed by the asp.net runtime and not the gateway.
However from a service you have access to session variables via HttpContext(http://msdn2.microsoft.com/en-us/library/system.web.httpcontext.session.aspx)
.... or the equivalent FluorineContext.Current.Session (so if you want to keep
session data for the client then keep it in that dictionary and not in a class
member). Additionally
services can have "session" scope (as defined in the Flex configuration files)
which means that each client will get it's own service object so member
variables (not declared static) will "act" as session variables. This case
however is not recommended for any scenario. There is
a Flash sample illustrating this concept in the [FluorineFx
Installdir]\Samples\Flash\Remoting\Activation folder (it does configure service
scope by using Flex service config files) Zoli From:
fluorine-bounces@...
[mailto:fluorine-bounces@...] On Behalf Of
Mikhail Pauw Hello, I’m pretty new to Fluorine and I run into a problem that I
can’t understand. I have a big background in Flex+PHP+Linux, but my current
position I have to work with Flex+ASP.NET+Windows, so I have two new components
to figure out. I started out with the examples that come with Fluorine. I
build forward on MultipleClientAuthentication. I’ve modified the SecureService
class a bit (source below) and the flex part (doesn’t need any extra
explanation). When I run the project on 2 different machines and I set the
SecureData on one of them and on the other machine I do get SecureData the
function returns the value that was set by machine1. What I expected that It
would return me the default value. So what appears to me is that Fluorine doesn’t create a
separate session for every client that uses the app. But I need it to work like
that. I hope someone can help me a bit forward with my
understanding of Fluorine. Thanks in advance, Mikhail using System; using FluorineFx; namespace ServiceLibrary { /// <summary> /// Summary description for
SecureService /// </summary> [RemotingService()] public class SecureService { private static
string _value = "default value"; public
SecureService() { } public string
GetSecureData() {
return _value; } public string
SetSecureData(string value) {
_value = value;
return value; } } } Tel: +31 (0)343 529
529 Fax: +31 (0)343 529
530 Yucat
mobile business solutions Postbus
208 • 3970 AE Driebergen Hoofdstraat
248 • 3972 LK Driebergen Disclaimer
The
information transmitted is intended only for the person or entity to which it is
addressed and may contain confidential and/or privileged material. Any review,
retransmission, dissemination or other use of, or taking of any action in
reliance upon, this information by persons or entities other than the intended
recipient is prohibited. If you received this in error, please contact the
sender and delete the material from any computer. _______________________________________________ fluorine mailing list fluorine@... http://fluorine.thesilentgroup.com/mailman/listinfo/fluorine_fluorine.thesilentgroup.com |
| Free Forum Powered by Nabble | Forum Help |