Showing posts with label sessions. Show all posts
Showing posts with label sessions. Show all posts

Saturday, March 31, 2012

Session Times Out.... Navigate to Login Page

When the sessions times out I would like to take the user to the login page.
Currently even though session times out user will come to know only when he
clicks on the screen. How to direct the user automatically to login page
once the session times out. I am using .Net Framework 1.1. and IIS 5
AmithYou could force the browser to refresh after a set amount of time:
Response.AppendHeader("Refresh", (Session.Timeout * 60 +
10).ToString() + "; URL=Login.aspx");
This will calculate the time to refresh using the Session timeout
value on the server (specified in minutes).
HTH,
Scott
http://www.OdeToCode.com
On Sat, 4 Sep 2004 11:14:52 -0700, "Amith Singh"
<AmithSin@.hotmail.com> wrote:

>When the sessions times out I would like to take the user to the login page
.
>Currently even though session times out user will come to know only when he
>clicks on the screen. How to direct the user automatically to login page
>once the session times out. I am using .Net Framework 1.1. and IIS 5
>Amith
>
Amith Singh wrote:

> When the sessions times out I would like to take the user to the login pag
e.
> Currently even though session times out user will come to know only when h
e
> clicks on the screen. How to direct the user automatically to login page
> once the session times out. I am using .Net Framework 1.1. and IIS 5
> Amith
>
Run a cli9ent sided time somwhere somehow and when I reaches the 20
minutes (default session timeout setting) you do something like a popup,
redirect, etc.
//Rutger
DoDotNet@.Gmail.com
www.RutgerSmit.com
Rutger Smit wrote:

> Amith Singh wrote:
>
> Run a cli9ent sided time somwhere somehow and when I reaches the 20
> minutes (default session timeout setting) you do something like a popup,
> redirect, etc.
>
Where was my mind?
Here the intended answer:
Run a clientsided script somewhere somehow and when it reaches the 20
minutes (default session timeout setting) you do something like a popup,
redirect, etc.
//Rutger
DoDotNet@.Gmail.com
www.RutgerSmit.com
I tried doing something like this before. I added some client side code on
page load to redirect after 20 minutes or whatever. Problem was a user
could stay on the same page for more than 20 minutes and keep the session
alive by posting back to itself. But when the client side script hit 20
minutes from the initial page load... whoops... times up.
I would like to see a solution myself.
Greg
"Rutger Smit" <DoDotNet@.gmail.com> wrote in message
news:10jk7k75fscpdbb@.corp.supernews.com...
> Rutger Smit wrote:
>
> Where was my mind?
> Here the intended answer:
>
> Run a clientsided script somewhere somehow and when it reaches the 20
> minutes (default session timeout setting) you do something like a popup,
> redirect, etc.
> --
> //Rutger
> DoDotNet@.Gmail.com
> www.RutgerSmit.com
Greg Burns wrote:

> I tried doing something like this before. I added some client side code o
n
> page load to redirect after 20 minutes or whatever. Problem was a user
> could stay on the same page for more than 20 minutes and keep the session
> alive by posting back to itself. But when the client side script hit 20
> minutes from the initial page load... whoops... times up.
> I would like to see a solution myself.
> Greg
>
>
>
Maybe you can make the script a little bit more intelligent.
On the client: do the time thing that redirects after 20 minutes.
Redirect the client to a special page that check wheter the session is
still alive or not. If it is, no broblem, redirect the client to the
HTTP_REFERER header value. If the session has expired, redir to login page.
//Rutger
DoDotNet@.Gmail.com
www.RutgerSmit.com
I would think if I redirected using HTTP_REFERER header value that it would
cause IsPostBack to False again, plus viewstate would not be retained. I
would be as if it was the first time visiting the page.
Here is some code I was playing with that I found while visiting the online
ticket ordering at sixflags.com.
function WarnUserTimeout()
{
alert('Your session has expired. You are being redirected to the park
selection page.')
window.location.href = "tickets_parkselect.asp";
}
<body OnLoad="window. setTimeout('WarnUserTimeout()',10*60*100
0)">
What would be great is if there was someway to reset the timer on every post
back...
Greg

> Maybe you can make the script a little bit more intelligent.
> On the client: do the time thing that redirects after 20 minutes.
> Redirect the client to a special page that check wheter the session is
> still alive or not. If it is, no broblem, redirect the client to the
> HTTP_REFERER header value. If the session has expired, redir to login
page.
> --
> //Rutger
> DoDotNet@.Gmail.com
> www.RutgerSmit.com
Greg Burns wrote:
> I would think if I redirected using HTTP_REFERER header value that it woul
d
> cause IsPostBack to False again, plus viewstate would not be retained. I
> would be as if it was the first time visiting the page.
> Here is some code I was playing with that I found while visiting the onlin
e
> ticket ordering at sixflags.com.
> function WarnUserTimeout()
> {
> alert('Your session has expired. You are being redirected to the park
> selection page.')
> window.location.href = "tickets_parkselect.asp";
> }
> <body OnLoad="window. setTimeout('WarnUserTimeout()',10*60*100
0)">
> What would be great is if there was someway to reset the timer on every po
st
> back...
> Greg
>
>
'reset the timer on every post back'
It does since it's JavaScript and thus running client sided.
If you're using frames you have to do some cross frame scripting with a
function that sets the timer to zero.
//Rutger
DoDotNet@.Gmail.com
www.RutgerSmit.com
You know, you're right.
I just retested it to make sure I wasn't making this up, but couldn't
duplicate it. I definately had a problem with this very issue when I first
attempted this. I will need to take a second look.
Thanks,
Greg

> 'reset the timer on every post back'
> It does since it's JavaScript and thus running client sided.
> If you're using frames you have to do some cross frame scripting with a
> function that sets the timer to zero.
> --
> //Rutger
> DoDotNet@.Gmail.com
> www.RutgerSmit.com

Session Times Out.... Navigate to Login Page

When the sessions times out I would like to take the user to the login page.
Currently even though session times out user will come to know only when he
clicks on the screen. How to direct the user automatically to login page
once the session times out. I am using .Net Framework 1.1. and IIS 5
AmithYou could force the browser to refresh after a set amount of time:

Response.AppendHeader("Refresh", (Session.Timeout * 60 +
10).ToString() + "; URL=Login.aspx");

This will calculate the time to refresh using the Session timeout
value on the server (specified in minutes).

HTH,

--
Scott
http://www.OdeToCode.com

On Sat, 4 Sep 2004 11:14:52 -0700, "Amith Singh"
<AmithSin@.hotmail.com> wrote:

>When the sessions times out I would like to take the user to the login page.
>Currently even though session times out user will come to know only when he
>clicks on the screen. How to direct the user automatically to login page
>once the session times out. I am using .Net Framework 1.1. and IIS 5
>Amith
Amith Singh wrote:

> When the sessions times out I would like to take the user to the login page.
> Currently even though session times out user will come to know only when he
> clicks on the screen. How to direct the user automatically to login page
> once the session times out. I am using .Net Framework 1.1. and IIS 5
> Amith

Run a cli9ent sided time somwhere somehow and when I reaches the 20
minutes (default session timeout setting) you do something like a popup,
redirect, etc.

--

//Rutger

DoDotNet@.Gmail.com
www.RutgerSmit.com
Rutger Smit wrote:

> Amith Singh wrote:
>
> Run a cli9ent sided time somwhere somehow and when I reaches the 20
> minutes (default session timeout setting) you do something like a popup,
> redirect, etc.

Where was my mind?
Here the intended answer:

Run a clientsided script somewhere somehow and when it reaches the 20
minutes (default session timeout setting) you do something like a popup,
redirect, etc.

--

//Rutger

DoDotNet@.Gmail.com
www.RutgerSmit.com
I tried doing something like this before. I added some client side code on
page load to redirect after 20 minutes or whatever. Problem was a user
could stay on the same page for more than 20 minutes and keep the session
alive by posting back to itself. But when the client side script hit 20
minutes from the initial page load... whoops... times up.

I would like to see a solution myself.

Greg

"Rutger Smit" <DoDotNet@.gmail.com> wrote in message
news:10jk7k75fscpdbb@.corp.supernews.com...
> Rutger Smit wrote:
> > Amith Singh wrote:
> > Run a cli9ent sided time somwhere somehow and when I reaches the 20
> > minutes (default session timeout setting) you do something like a popup,
> > redirect, etc.
> Where was my mind?
> Here the intended answer:
>
> Run a clientsided script somewhere somehow and when it reaches the 20
> minutes (default session timeout setting) you do something like a popup,
> redirect, etc.
> --
> //Rutger
> DoDotNet@.Gmail.com
> www.RutgerSmit.com
Greg Burns wrote:

> I tried doing something like this before. I added some client side code on
> page load to redirect after 20 minutes or whatever. Problem was a user
> could stay on the same page for more than 20 minutes and keep the session
> alive by posting back to itself. But when the client side script hit 20
> minutes from the initial page load... whoops... times up.
> I would like to see a solution myself.
> Greg
>>Where was my mind?
>>Here the intended answer:
>>
>>
>>Run a clientsided script somewhere somehow and when it reaches the 20
>>minutes (default session timeout setting) you do something like a popup,
>> redirect, etc.
>>
>>--
>>
>>//Rutger
>>
>>DoDotNet@.Gmail.com
>>www.RutgerSmit.com

Maybe you can make the script a little bit more intelligent.
On the client: do the time thing that redirects after 20 minutes.
Redirect the client to a special page that check wheter the session is
still alive or not. If it is, no broblem, redirect the client to the
HTTP_REFERER header value. If the session has expired, redir to login page.

--

//Rutger

DoDotNet@.Gmail.com
www.RutgerSmit.com
I would think if I redirected using HTTP_REFERER header value that it would
cause IsPostBack to False again, plus viewstate would not be retained. I
would be as if it was the first time visiting the page.

Here is some code I was playing with that I found while visiting the online
ticket ordering at sixflags.com.

function WarnUserTimeout()
{
alert('Your session has expired. You are being redirected to the park
selection page.')
window.location.href = "tickets_parkselect.asp";
}

<body OnLoad="window.setTimeout('WarnUserTimeout()',10*60*1000)"
What would be great is if there was someway to reset the timer on every post
back...

Greg

> Maybe you can make the script a little bit more intelligent.
> On the client: do the time thing that redirects after 20 minutes.
> Redirect the client to a special page that check wheter the session is
> still alive or not. If it is, no broblem, redirect the client to the
> HTTP_REFERER header value. If the session has expired, redir to login
page.
> --
> //Rutger
> DoDotNet@.Gmail.com
> www.RutgerSmit.com
Greg Burns wrote:
> I would think if I redirected using HTTP_REFERER header value that it would
> cause IsPostBack to False again, plus viewstate would not be retained. I
> would be as if it was the first time visiting the page.
> Here is some code I was playing with that I found while visiting the online
> ticket ordering at sixflags.com.
> function WarnUserTimeout()
> {
> alert('Your session has expired. You are being redirected to the park
> selection page.')
> window.location.href = "tickets_parkselect.asp";
> }
> <body OnLoad="window.setTimeout('WarnUserTimeout()',10*60*1000)">
> What would be great is if there was someway to reset the timer on every post
> back...
> Greg

'reset the timer on every post back'
It does since it's JavaScript and thus running client sided.
If you're using frames you have to do some cross frame scripting with a
function that sets the timer to zero.

--

//Rutger

DoDotNet@.Gmail.com
www.RutgerSmit.com
You know, you're right.

I just retested it to make sure I wasn't making this up, but couldn't
duplicate it. I definately had a problem with this very issue when I first
attempted this. I will need to take a second look.

Thanks,
Greg

> 'reset the timer on every post back'
> It does since it's JavaScript and thus running client sided.
> If you're using frames you have to do some cross frame scripting with a
> function that sets the timer to zero.
> --
> //Rutger
> DoDotNet@.Gmail.com
> www.RutgerSmit.com

Session troubble with IE 5 on Mac

I'm having troubble with sessions when accessing my ASP.NET 2.0 BETA 2 webapp using IE 5.2 on a Mac. It seems like everytime I reload a page, I get a new session id. Firefox on the same Mac works fine and keeps it session as long as it should.
I've tested this with a minimal webapp aswell. Just created one single page which prints Session.SessionId. The webapp has a default Web.config.
Is this a known issue?hello.
if i remember correctly, you'll only mantain your session id if you keep any data there. if you don't, you'll get a new id in every request...
The same thing happens if I add data to the session, so i don't think that is the problem. Have any of you successfully managed to use sessions with IE 5 on Mac?
Well, the problem was solved when I installed the final version of ASP.NET 2.0, so it looks like it had something to do with the build I was running.. Weird that nobody else has had this problem.

session uniqueid

Do sessions automatically create a unique ID constraint like a GUID when they are instantiated on a web page? If so how can i retrieve it in C#?

ThanksEach session has a session ID. Use Session.SessionID to get it. This id is, however, not unique all the time.

Session values across subdomains

Is it possible to keep sessions between subdomains?
I.e
If I have a site "shop.com" and when user acess his personal page it's
"secure.shop.com"
Is it possible to share the session values between these two?
Why I ask is because the hosting company gives a discount on SSL
certificates if I put it at secure.shop.com instead of the entire site
and since I only need checkout and personal info pages to be secure I
was thinking that I could put that info in the secure.shop.com domain
but I am worried I will loose session info like cartid, userid and
such..
Regards,
Danielit depends. to share the session cookie, you override the domain in the
session cookie, pretty simple. if secure.shop.com and shop.com are the
same site then you are done. if they are different sites and you use
inproc session, then you will need some way to pass session data from
one site to another (say a web service).
-- bruce (sqlwork.com)
daniel.westerberg@.ruilong.se wrote:
> Is it possible to keep sessions between subdomains?
> I.e
> If I have a site "shop.com" and when user acess his personal page it's
> "secure.shop.com"
> Is it possible to share the session values between these two?
> Why I ask is because the hosting company gives a discount on SSL
> certificates if I put it at secure.shop.com instead of the entire site
> and since I only need checkout and personal info pages to be secure I
> was thinking that I could put that info in the secure.shop.com domain
> but I am worried I will loose session info like cartid, userid and
> such..
> Regards,
> Daniel

Thursday, March 29, 2012

Session values across subdomains

Is it possible to keep sessions between subdomains?
I.e
If I have a site "shop.com" and when user acess his personal page it's
"secure.shop.com"
Is it possible to share the session values between these two?
Why I ask is because the hosting company gives a discount on SSL
certificates if I put it at secure.shop.com instead of the entire site
and since I only need checkout and personal info pages to be secure I
was thinking that I could put that info in the secure.shop.com domain
but I am worried I will loose session info like cartid, userid and
such..

Regards,
Danielit depends. to share the session cookie, you override the domain in the
session cookie, pretty simple. if secure.shop.com and shop.com are the
same site then you are done. if they are different sites and you use
inproc session, then you will need some way to pass session data from
one site to another (say a web service).

-- bruce (sqlwork.com)

daniel.westerberg@.ruilong.se wrote:

Quote:

Originally Posted by

Is it possible to keep sessions between subdomains?
I.e
If I have a site "shop.com" and when user acess his personal page it's
"secure.shop.com"
Is it possible to share the session values between these two?
Why I ask is because the hosting company gives a discount on SSL
certificates if I put it at secure.shop.com instead of the entire site
and since I only need checkout and personal info pages to be secure I
was thinking that I could put that info in the secure.shop.com domain
but I am worried I will loose session info like cartid, userid and
such..
>
Regards,
Daniel

session values

I'm having a problem with sessions. Basically, my site has a place where a
user logs in, and they're taken to a page with the order details and items
from their shopping cart. This order detail page checks a session variable to
check that the customer is logged in. The problem is that some users are
taken back to the login page even though they are entering the correct
username and password. We know that their cookies are on. We have a script on
another page that checks for cookies, and we've scanned through the logs and
it shows that their cookies are on. What is more baffling is that many users
are going through ok, but some are not, and there aren't any patterns as to
their browser type, or isp origin or whatnot. Anyone have a similar issue?Are you using Forms Authentication? If not, you may find that arrangement
more reliable. You can easily set up custom Forms Auth against a database.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com

"George" wrote:

> I'm having a problem with sessions. Basically, my site has a place where a
> user logs in, and they're taken to a page with the order details and items
> from their shopping cart. This order detail page checks a session variable to
> check that the customer is logged in. The problem is that some users are
> taken back to the login page even though they are entering the correct
> username and password. We know that their cookies are on. We have a script on
> another page that checks for cookies, and we've scanned through the logs and
> it shows that their cookies are on. What is more baffling is that many users
> are going through ok, but some are not, and there aren't any patterns as to
> their browser type, or isp origin or whatnot. Anyone have a similar issue?
>

session values

I'm having a problem with sessions. Basically, my site has a place where a
user logs in, and they're taken to a page with the order details and items
from their shopping cart. This order detail page checks a session variable t
o
check that the customer is logged in. The problem is that some users are
taken back to the login page even though they are entering the correct
username and password. We know that their cookies are on. We have a script o
n
another page that checks for cookies, and we've scanned through the logs and
it shows that their cookies are on. What is more baffling is that many users
are going through ok, but some are not, and there aren't any patterns as to
their browser type, or isp origin or whatnot. Anyone have a similar issue?Are you using Forms Authentication? If not, you may find that arrangement
more reliable. You can easily set up custom Forms Auth against a database.
Peter
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com
"George" wrote:

> I'm having a problem with sessions. Basically, my site has a place where a
> user logs in, and they're taken to a page with the order details and items
> from their shopping cart. This order detail page checks a session variable
to
> check that the customer is logged in. The problem is that some users are
> taken back to the login page even though they are entering the correct
> username and password. We know that their cookies are on. We have a script
on
> another page that checks for cookies, and we've scanned through the logs a
nd
> it shows that their cookies are on. What is more baffling is that many use
rs
> are going through ok, but some are not, and there aren't any patterns as t
o
> their browser type, or isp origin or whatnot. Anyone have a similar issue?
>

Session values across subdomains

Is it possible to keep sessions between subdomains?
I.e
If I have a site "shop.com" and when user acess his personal page it's
"secure.shop.com"
Is it possible to share the session values between these two?
Why I ask is because the hosting company gives a discount on SSL
certificates if I put it at secure.shop.com instead of the entire site
and since I only need checkout and personal info pages to be secure I
was thinking that I could put that info in the secure.shop.com domain
but I am worried I will loose session info like cartid, userid and
such..
Regards,
Danielit depends. to share the session cookie, you override the domain in the
session cookie, pretty simple. if secure.shop.com and shop.com are the
same site then you are done. if they are different sites and you use
inproc session, then you will need some way to pass session data from
one site to another (say a web service).
-- bruce (sqlwork.com)
daniel.westerberg@.ruilong.se wrote:
> Is it possible to keep sessions between subdomains?
> I.e
> If I have a site "shop.com" and when user acess his personal page it's
> "secure.shop.com"
> Is it possible to share the session values between these two?
> Why I ask is because the hosting company gives a discount on SSL
> certificates if I put it at secure.shop.com instead of the entire site
> and since I only need checkout and personal info pages to be secure I
> was thinking that I could put that info in the secure.shop.com domain
> but I am worried I will loose session info like cartid, userid and
> such..
> Regards,
> Daniel

Saturday, March 24, 2012

Session variable scope in a Load Balanced environment

I have the following scenario in a true load balanced environment (without
sticky sessions):
There are 2 ASPX pages. I want to pass an object from the first page to the
second page. On the btnContinue_Click event of Page1.aspx, I create the
object and store it in a session variable. The next statement would be
Response.Redirect("Page2.aspx"). The code appears like this:
private void btnContinue_Click(object sender, EventArgs e)
{
OrderInfo orderInfo = new OrderInfo();
orderInfo.Property1 = "Property1";
orderInfo.Property2 = "Property2" Session["orderInfo"] =
orderInfo;
Response.Redirect("Page2.aspx");
}On Page2.aspx, on the Page_Load event, I retrieve the object from the
Session variable and put it in a OrderInfo object and then remove the
session variable. The code looks similar to below:
void Page_Load(object sender, EventArgs e)
{
OrderInfo orderInfo = new OrderInfo();
orderInfo = (OrderInfo)Session["orderInfo"];
Session.Remove("orderInfo");
}My understanding is - creating the object, putting it in a Session
variable, redirecting to another page and retrieval of the object in the
second page - all these happens in one server call. I don't care if the
Session variable is lost after this call. That is the reason I remove the
variable from session state.
My question is - are there any chances that the Session variable will lose
its value in the above scenario because of load balancing?
Any help will be appriciated.
Thanks!On Wed, 28 Dec 2005 11:57:17 +0530, Vidyadhar Joshi wrote:

> I have the following scenario in a true load balanced environment (without
> sticky sessions):
> There are 2 ASPX pages. I want to pass an object from the first page to th
e
> second page. On the btnContinue_Click event of Page1.aspx, I create the
> object and store it in a session variable. The next statement would be
> Response.Redirect("Page2.aspx"). The code appears like this:
> private void btnContinue_Click(object sender, EventArgs e)
> {
> OrderInfo orderInfo = new OrderInfo();
> orderInfo.Property1 = "Property1";
> orderInfo.Property2 = "Property2" Session["orderInfo"] =
> orderInfo;
> Response.Redirect("Page2.aspx");
> }On Page2.aspx, on the Page_Load event, I retrieve the object from the
> Session variable and put it in a OrderInfo object and then remove the
> session variable. The code looks similar to below:
> void Page_Load(object sender, EventArgs e)
> {
> OrderInfo orderInfo = new OrderInfo();
> orderInfo = (OrderInfo)Session["orderInfo"];
> Session.Remove("orderInfo");
> }My understanding is - creating the object, putting it in a Session
> variable, redirecting to another page and retrieval of the object in the
> second page - all these happens in one server call. I don't care if the
> Session variable is lost after this call. That is the reason I remove the
> variable from session state.
> My question is - are there any chances that the Session variable will lose
> its value in the above scenario because of load balancing?
> Any help will be appriciated.
> Thanks!
In my experience, load balancing (without sticky), will create problems
for you.
You will also have problems with the Session being dumped due to timeout,
restarts of the server, etc.

Session variable scope in a Load Balanced environment

I have the following scenario in a true load balanced environment (without
sticky sessions):

There are 2 ASPX pages. I want to pass an object from the first page to the
second page. On the btnContinue_Click event of Page1.aspx, I create the
object and store it in a session variable. The next statement would be
Response.Redirect("Page2.aspx"). The code appears like this:
private void btnContinue_Click(object sender, EventArgs e)
{
OrderInfo orderInfo = new OrderInfo();
orderInfo.Property1 = "Property1";
orderInfo.Property2 = "Property2" Session["orderInfo"] =
orderInfo;
Response.Redirect("Page2.aspx");
}On Page2.aspx, on the Page_Load event, I retrieve the object from the
Session variable and put it in a OrderInfo object and then remove the
session variable. The code looks similar to below:
void Page_Load(object sender, EventArgs e)
{
OrderInfo orderInfo = new OrderInfo();
orderInfo = (OrderInfo)Session["orderInfo"];
Session.Remove("orderInfo");
}My understanding is - creating the object, putting it in a Session
variable, redirecting to another page and retrieval of the object in the
second page - all these happens in one server call. I don't care if the
Session variable is lost after this call. That is the reason I remove the
variable from session state.

My question is - are there any chances that the Session variable will lose
its value in the above scenario because of load balancing?

Any help will be appriciated.

Thanks!On Wed, 28 Dec 2005 11:57:17 +0530, Vidyadhar Joshi wrote:

> I have the following scenario in a true load balanced environment (without
> sticky sessions):
> There are 2 ASPX pages. I want to pass an object from the first page to the
> second page. On the btnContinue_Click event of Page1.aspx, I create the
> object and store it in a session variable. The next statement would be
> Response.Redirect("Page2.aspx"). The code appears like this:
> private void btnContinue_Click(object sender, EventArgs e)
> {
> OrderInfo orderInfo = new OrderInfo();
> orderInfo.Property1 = "Property1";
> orderInfo.Property2 = "Property2" Session["orderInfo"] =
> orderInfo;
> Response.Redirect("Page2.aspx");
> }On Page2.aspx, on the Page_Load event, I retrieve the object from the
> Session variable and put it in a OrderInfo object and then remove the
> session variable. The code looks similar to below:
> void Page_Load(object sender, EventArgs e)
> {
> OrderInfo orderInfo = new OrderInfo();
> orderInfo = (OrderInfo)Session["orderInfo"];
> Session.Remove("orderInfo");
> }My understanding is - creating the object, putting it in a Session
> variable, redirecting to another page and retrieval of the object in the
> second page - all these happens in one server call. I don't care if the
> Session variable is lost after this call. That is the reason I remove the
> variable from session state.
> My question is - are there any chances that the Session variable will lose
> its value in the above scenario because of load balancing?
> Any help will be appriciated.
> Thanks!
In my experience, load balancing (without sticky), will create problems
for you.
You will also have problems with the Session being dumped due to timeout,
restarts of the server, etc.

Thursday, March 22, 2012

Session Variables

I am developing a web application using frames(main and menu). User logs in, sessions are created and when the user logs out the sessions are set to null. Logout button is in the menu frame. This work fine for the main frame but the menu frame still think that the sessions are not created because it's giving me a null value. Can anyone tell me what I am doing wrong here? I don't want to use cookies. Thanks for any helpCan anyone tell me what I am doing wrong here?

You are using frames, don't use them ;)

You are always going to be fighting with this because the browser sees the 2 frame windows as separate windows being openned. So if you set a session in one, it doesn't associate it with the other. You might be able to set the session in your core page that has the source for creating the frames, but there are no guarantees.

So I stick with my suggestion of dumping the frameset and using tables since you don't want to be bothered with cookies (which are as secure and usable as sessions mind you)