Showing posts with label persist. Show all posts
Showing posts with label persist. Show all posts

Thursday, March 29, 2012

Session Variable across applications

If I have multiple applications inside a website, will session variables
persist if I like between the two applications?That's 'link' between two applications.
DogBoy,

I'd say yes

Cheers Al
As long as they're under the same website in IIS.
This doesn't seem to be working, the session variable is coming up null when I try to
jump applications in the same website. Any ideas?
Damn, looks like I was wrong. You can not share session variables across apps. You will need to pass them across using encrypted querystrings, post requests, and the like.
I'm not sure I fully understand what you're trying to do. This is what I think you're doing, let me know if this is not right -

your main site has a url like this

www.mysite.com

Note: This assumes you don't have extra domain names set up, trying to keep it simple!

To access app 1 you'd enter www.mysite.com/app1
To access app 1 you'd enter www.mysite.com/app2

If this is what you're doing then I know that cookies and session variables can definitely be shared because I'm doing it with a project I'm currently working on.

Cheers Al
That's what I'm trying to do - but the session variables are not jumping apps. The apps are configured in IIS, are yours configured that way or just sub directories?

I was thinking of using cookies, I know they are persistent but apparantly not session variables.
Mine are sub folder under the main site.

So I guess that's the end of that
I was thinking of what aconybeare mentioned here too, but then I realized you're talking about virtual directories, which are basically separate ASP.NET applications.

Tuesday, March 13, 2012

session variables don't persist

Hi
Some mystery. Until I updated my Windows XP I could preserve session
variables through aspx pages. Now the session variables are getting lost. I
cannot preserve them. I have explicitly modified the web.config file to
enableSessionState, but still the variables are getting lost.
I found a knowledgbase article 316112 - PRB Session Variables Do Not Persist
Between Requests After You Install Internet Explorer Security Patch
MS01-055.htm
That explains that it is due to the security patch and suggest to change the
servername. But is there another way to get aroudn this problem?
Dew BaboeramYes, the article states that you can use IP address instead of server name.
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
"Dew Baboeram" <dew.baboeram@.amcon.nl> wrote in message
news:0YiVc.3097$%4.79950@.typhoon.bart.nl...
> Hi
> Some mystery. Until I updated my Windows XP I could preserve session
> variables through aspx pages. Now the session variables are getting lost.
I
> cannot preserve them. I have explicitly modified the web.config file to
> enableSessionState, but still the variables are getting lost.
> I found a knowledgbase article 316112 - PRB Session Variables Do Not
Persist
> Between Requests After You Install Internet Explorer Security Patch
> MS01-055.htm
> That explains that it is due to the security patch and suggest to change
the
> servername. But is there another way to get aroudn this problem?
>
> Dew Baboeram
>

session variables dont persist

Hi

Some mystery. Until I updated my windows xp I could preserve session
variables through aspx pages. Now the session variables are getting lost. I
cannot preserve them. I have explicitly modified the web.config file to
enableSessionState, but still the variables are getting lost.
I found a knowledgbase article 316112 - PRB Session Variables Do Not Persist
Between Requests After You Install Internet Explorer Security Patch
MS01-055.htm
That explains that it is due to the security patch and suggest to change the
servername. But is there another way to get aroudn this problem?

Dew BaboeramYes, the article states that you can use IP address instead of server name.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Dew Baboeram" <dew.baboeram@.amcon.nl> wrote in message
news:0YiVc.3097$%4.79950@.typhoon.bart.nl...
> Hi
> Some mystery. Until I updated my windows xp I could preserve session
> variables through aspx pages. Now the session variables are getting lost.
I
> cannot preserve them. I have explicitly modified the web.config file to
> enableSessionState, but still the variables are getting lost.
> I found a knowledgbase article 316112 - PRB Session Variables Do Not
Persist
> Between Requests After You Install Internet Explorer Security Patch
> MS01-055.htm
> That explains that it is due to the security patch and suggest to change
the
> servername. But is there another way to get aroudn this problem?
>
> Dew Baboeram

session variables don't persist ,why?

Hello:
My problem is that in my login page, I authenticate the user and set a
session variable:
Session("strname") = dr("userlname") & ", " & dr("userfname") & " "
& dr("usermi")
FormsAuthentication.SetAuthCookie(lngID, False)
and then redirect to another page. On that page, when I try:
Response.Write(Session("strname"))
Response.Write(Page.User.Identity.Name)
they're both empty. My web.config includes:
<authentication mode="Forms">
<forms name="P" loginUrl="intranet/login.aspx" protection="All"
path="/" />
</authentication>
The intranet/login.aspx page refers to a page on the server (not part of
this .sln) but I wouldn't think that would matter because it's
authenticating the user in the login page above.
Can anyone help?! Thanks!session refers to current instance of user interaction with an application.
ie if you talk to applicaiton 1 you have one session
if you go to another application like you are (for authentication) its a
different / unique session for that application
since sessions are not shared between applications you dont have any access
to the variables you set earlier.
ie you jumped back to your orignal session which unforntunately dont have
those variables.
Another thing if you try to read session variables it is always advisable to
check them for null values
if not Session("strname") is null then
' read the variables here
end if
something like that..
Regards,
Hermit Dave
(http://hdave.blogspot.com)
"Raed Sawalha" <raed_sawalha@.hotmail.com> wrote in message
news:#TjZprqpEHA.3172@.TK2MSFTNGP10.phx.gbl...
> Hello:
> My problem is that in my login page, I authenticate the user and set a
> session variable:
> Session("strname") = dr("userlname") & ", " & dr("userfname") & "
"
> & dr("usermi")
> FormsAuthentication.SetAuthCookie(lngID, False)
> and then redirect to another page. On that page, when I try:
> Response.Write(Session("strname"))
> Response.Write(Page.User.Identity.Name)
> they're both empty. My web.config includes:
> <authentication mode="Forms">
> <forms name="P" loginUrl="intranet/login.aspx"
protection="All"
> path="/" />
> </authentication>
> The intranet/login.aspx page refers to a page on the server (not part of
> this .sln) but I wouldn't think that would matter because it's
> authenticating the user in the login page above.
> Can anyone help?! Thanks!
>

session variables dont persist ,why?

Hello:
My problem is that in my login page, I authenticate the user and set a
session variable:
Session("strname") = dr("userlname") & ", " & dr("userfname") & " "
& dr("usermi")
FormsAuthentication.SetAuthCookie(lngID, False)

and then redirect to another page. On that page, when I try:
Response.Write(Session("strname"))
Response.Write(Page.User.Identity.Name)

they're both empty. My web.config includes:
<authentication mode="Forms">
<forms name="P" loginUrl="intranet/login.aspx" protection="All"
path="/" />
</authentication
The intranet/login.aspx page refers to a page on the server (not part of
this .sln) but I wouldn't think that would matter because it's
authenticating the user in the login page above.

Can anyone help?! Thanks!session refers to current instance of user interaction with an application.

ie if you talk to applicaiton 1 you have one session
if you go to another application like you are (for authentication) its a
different / unique session for that application
since sessions are not shared between applications you dont have any access
to the variables you set earlier.
ie you jumped back to your orignal session which unforntunately dont have
those variables.

Another thing if you try to read session variables it is always advisable to
check them for null values
if not Session("strname") is null then

' read the variables here

end if
something like that..

--

Regards,

Hermit Dave
(http://hdave.blogspot.com)
"Raed Sawalha" <raed_sawalha@.hotmail.com> wrote in message
news:#TjZprqpEHA.3172@.TK2MSFTNGP10.phx.gbl...
> Hello:
> My problem is that in my login page, I authenticate the user and set a
> session variable:
> Session("strname") = dr("userlname") & ", " & dr("userfname") & "
"
> & dr("usermi")
> FormsAuthentication.SetAuthCookie(lngID, False)
> and then redirect to another page. On that page, when I try:
> Response.Write(Session("strname"))
> Response.Write(Page.User.Identity.Name)
> they're both empty. My web.config includes:
> <authentication mode="Forms">
> <forms name="P" loginUrl="intranet/login.aspx"
protection="All"
> path="/" />
> </authentication>
> The intranet/login.aspx page refers to a page on the server (not part of
> this .sln) but I wouldn't think that would matter because it's
> authenticating the user in the login page above.
> Can anyone help?! Thanks!