Showing posts with label website. Show all posts
Showing posts with label website. Show all posts

Saturday, March 31, 2012

Session time-out,when the page breaks?

Hi..

I had published a website in the server( I am using VS 2005,ASP.NET2.0, With C#) . I tried testing the site by asking several users to login to the website and do unit testing. At one instance of time, the page breaks for a particular user. When the page breaks, the other users who are tesing in their machine are getting a session time-out and are forced to log out.

Why is such a session-time out issue happening, when one of the users page breaks. I have set the session variable to 20 minutes,which is the default. But what's confusing is , when one of the user's page breaks, the others get a session time-out? Why is such a session-time out occuring?

Please help.

Thanks.

What do you mean when you say "the page breaks?" If an app pool cycles you might see this effect. Have you diagnosed the "page break" to see what happens?

Jeff


Thank you very much for the reply.

The page break, I referred is the page crashing(asp.net error page) .I have customized the error page to show, An Unexpected error occurred, please try after some time.

But when the user tries the same steps to find the page crash, he is not able to, as the page works well. This is a kind of absurd. The page is not crashing always, but it is random. I checked the log, but it was not providing much information. I also could not re-trace the page crash, as the page worked well.

But why is the session getting timed out for the other users, when one of the users page crashes?

Thanks.


Hi..

I am sorry that I forgot to include a scenario in my web page,which i am doing. I have written a code to delete a folder in the session end in global.asax. When i commented the code, and tried testing, the session time out was not occuring.

I searched in the google, and came out with this:

http://www.velocityreviews.com/forums/t116975-all-session-are-getting-down-when-i-delete-sessions-folders.html

Is this the reason for all sessions getting timed-out, when a page crashes?

Thanks


Hi Venkatzeus,

As far as i know, if you delete a folder which is in your application directory, the appDomain will restart, and you will lose your session.

I hope this helps.


This happens as your worker process memory limits get full and asp.net worker process gets restarted. how to do this setting you can find at

http://www.asp.net/faq/AspNetAndIIS6.aspx

But I think you needs to findout why its getting full.

When you get this error check server CPU Usage what it shows?

then debug.


HI,,

Thank you very much for the reply. I will try with it and provide the results.

Thanks

Thursday, March 29, 2012

Session Var

Ok, i made a gaming clan website. It has a login that uses session vars to store the username and pwd. I am experiencing an issue of logging out.

Does the time out mean time from creation?, like 20 min after the var is created, it kills it.

How do i keep the session var open while the person is on the site.session variables are active for the time that a person is on the site and is actively viewing (interacting with the server) the site.

If a person does not send any information back to the server within 20 minutes then their session variable expires. If they interact with the server (clicking on a link, posting a form etc) then their session variable is kept alive until the time they explicitly logout (Click on a logout button), close the browser or do not interact with the server for the default session timeout time..

hth
Cheers
MarkusJ
thats what i have heard but... it like isn't true for my case for some reason, cause i could be surfing around logged in and i will get logged out all of the sudden. I also have a page that refreshes its self every 5 min on a very small frame on the left bar...
Are you using frames/ pop up windows?
i have 2 main frames, a leftbar and a main window. Then i have the refreshing frame in the leftbar frame.
AFAIK there are some issues with frames and session variables

A quick search of the newsgroups reflects this

http://tinyurl.com/ifiw

Cheers
MarkusJ
that is only for ie below 5.5

and i don't really lose them between frames, they just die after 20 min, even if the person is active.
You should be using a different way to authenticate users like form. Holding the log in values in session variables isn't the way to do it. MS provided a couple different authentication methods, and they are full featured and quite good at what they do. You can use Windows, Forms, Passport or None (which is what you are doing). You should be using Forms authentication if you want to handle the authentication through code. Lethal posted some good authentication code at this link:
http://www.vbforums.com/showthread.php?s=&threadid=245643
Indeed,

like hellswraith said you ... There are other sorts of authentication. Session variables are very good to keep data in memory for a short time.
Use an authentication ticket

Dim objTicket As FormsAuthenticationTicket = New FormsAuthenticationTicket(1, Username, DateTime.Now, DateTime.Now.AddMinutes(60), False, String.Join("|", varRole))

1,
Username,
DateTime.Now,
DateTime.Now.AddMinutes(60), <<< EXPIRE DATE
False,
String.Join("|", varRole))

u can find full code for using the ticket in post http://www.vbforums.com/showthread.php?s=&threadid=257238

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.

session variable and window.open

Hi all, I have a website where I want to be able to 'pop up' a window using
the window.open call in JavaScript.
I remember back in the old days of classic ASP there was a problem where a
call to window.open started a new session and all session variables were
lost.
I did a quick check in ASP.Net and the session variables were saved between
the parent window and the new 'pop up' window so that's fine.

What I want to know is there any problems with doing this (Browser issues
etc) as I do not want to pass though any information via the Querystring
(Security issue).

Thanks in advance
MarkHi,

As in the old happy days of ASP and COM using window.open still can end
up with new session. if you want to be sure that the new window maintain
the same session use javascript to pass cookies from the calling page to
the new one.

Natty Gur, CTO
Dao2Com Ltd.
28th Baruch Hirsch st. Bnei-Brak
Israel , 51114

Phone Numbers:
Office: +972-(0)3-5786668
Fax: +972-(0)3-5703475
Mobile: +972-(0)58-888377

Know the overall picture

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
correction: it still holds true even in classic ASP.

"Mark" <mark@.yahoo.comN0SPAM> wrote in message
news:beimm4$fuu$1@.lust.ihug.co.nz...
> Hi all, I have a website where I want to be able to 'pop up' a window
using
> the window.open call in JavaScript.
> I remember back in the old days of classic ASP there was a problem where a
> call to window.open started a new session and all session variables were
> lost.
> I did a quick check in ASP.Net and the session variables were saved
between
> the parent window and the new 'pop up' window so that's fine.
> What I want to know is there any problems with doing this (Browser issues
> etc) as I do not want to pass though any information via the Querystring
> (Security issue).
> Thanks in advance
> Mark
i tried to prove i said that using window.open in client-side script will
produce the same SessionID by creating two asp pages.

default.asp
<script language="javascript">
function windowOpen()
{ window.open("another.asp","_blank"); }
</script
This is a <a href="http://links.10026.com/?link=javascript:windowOpen();">link</a>
The session id = <%=Session.SessionID%
another.asp

<%= Session.SessionID %
Walah!!! they produced the same SessionID value!!!

try it!

"Natty Gur" <natty@.dao2com.com> wrote in message
news:usKjx5pRDHA.2460@.TK2MSFTNGP10.phx.gbl...
> Hi,
> As in the old happy days of ASP and COM using window.open still can end
> up with new session. if you want to be sure that the new window maintain
> the same session use javascript to pass cookies from the calling page to
> the new one.
> Natty Gur, CTO
> Dao2Com Ltd.
> 28th Baruch Hirsch st. Bnei-Brak
> Israel , 51114
> Phone Numbers:
> Office: +972-(0)3-5786668
> Fax: +972-(0)3-5703475
> Mobile: +972-(0)58-888377
> Know the overall picture
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!
Yes I know. but in my 10 years of expirence and almost 3 in ASP.NET the
same code that works, from time to time dont behave as expected and
create new session.

Natty Gur, CTO
Dao2Com Ltd.
28th Baruch Hirsch st. Bnei-Brak
Israel , 51114

Phone Numbers:
Office: +972-(0)3-5786668
Fax: +972-(0)3-5703475
Mobile: +972-(0)58-888377

Know the overall picture

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
i see that... thanks for your suggestion :) i guess i have to take that
one as a good advice.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Monday, March 26, 2012

Session variable data being lost

Our website contains session variables that are used to validate if a user i
s
logged in etc. We have found that these variables are randomly lost while
navigating the website.
We set up some basic code (as shown below) which used a meta tag to refresh
an aspx page every second. It tests whether there is any content in a
session variable, if not then it writes a timestamp to a text file, recreate
s
the data in the variable and continues. As you can see this script contains
no databases calls etc.
<%response.write(session("Username") & "<br>" & Session.SessionID)
if len(session("Username"))=0 then
Dim FILENAME as String = Server.MapPath("Output.txt")
Dim objStreamWriter as StreamWriter
objStreamWriter = File.AppendText(FILENAME)
objStreamWriter.WriteLine(DateTime.Now.ToString())
objStreamWriter.Close()
session("Username") = "HelloWorld"
end if %>
The output looks like this:
18/04/2006 15:08:18
18/04/2006 15:11:37
18/04/2006 15:18:39
18/04/2006 15:21:40
18/04/2006 15:31:41
18/04/2006 15:34:43
18/04/2006 15:41:44
18/04/2006 15:50:46
18/04/2006 15:56:49
18/04/2006 15:58:47
18/04/2006 16:03:50
18/04/2006 16:06:49
18/04/2006 16:08:49
18/04/2006 16:11:50
18/04/2006 16:14:55
18/04/2006 16:16:55
18/04/2006 16:18:54
18/04/2006 16:23:00
18/04/2006 16:26:00
18/04/2006 16:31:01
18/04/2006 16:35:03
18/04/2006 16:37:05
18/04/2006 16:39:04
18/04/2006 16:41:06
18/04/2006 16:43:12
18/04/2006 16:45:10
18/04/2006 16:50:09
As you can see the session data is dropped usually under 10 minutes but
completely randomly. We have also found that the session id stays the same.
I
assume the reason it does stay the same is because that specific data is hel
d
on the client and passed to the server on every communication to the server.
Our webhosting does not support Stateserver or SQLServer state management,
so the only option is InProc. From searching several articles we have found
there are many reasons why this data can be lost. For example if any .config
files or bin files are changed or touched (eg by AV software) then the
application resets and therefore loses the session data. This has also been
tested by us and can confirm this happens.
As our website is hosted on a shared server, we assume that other sites are
or could be having similar issues as us.
Has anyone experienced this particular issue before?
Thanks in advance.
Regards
Sarah Marriott.Tell your ISP to turn off the AV check.
"Sarah Marriott" <Sarah Marriott@.discussions.microsoft.com> wrote in message
news:11DF6E98-DF76-4995-90D4-D594FDADC120@.microsoft.com...
> Our website contains session variables that are used to validate if a user
> is
> logged in etc. We have found that these variables are randomly lost while
> navigating the website.
> We set up some basic code (as shown below) which used a meta tag to
> refresh
> an aspx page every second. It tests whether there is any content in a
> session variable, if not then it writes a timestamp to a text file,
> recreates
> the data in the variable and continues. As you can see this script
> contains
> no databases calls etc.
> <%response.write(session("Username") & "<br>" & Session.SessionID)
> if len(session("Username"))=0 then
> Dim FILENAME as String = Server.MapPath("Output.txt")
> Dim objStreamWriter as StreamWriter
> objStreamWriter = File.AppendText(FILENAME)
> objStreamWriter.WriteLine(DateTime.Now.ToString())
> objStreamWriter.Close()
> session("Username") = "HelloWorld"
> end if %>
> The output looks like this:
> 18/04/2006 15:08:18
> 18/04/2006 15:11:37
> 18/04/2006 15:18:39
> 18/04/2006 15:21:40
> 18/04/2006 15:31:41
> 18/04/2006 15:34:43
> 18/04/2006 15:41:44
> 18/04/2006 15:50:46
> 18/04/2006 15:56:49
> 18/04/2006 15:58:47
> 18/04/2006 16:03:50
> 18/04/2006 16:06:49
> 18/04/2006 16:08:49
> 18/04/2006 16:11:50
> 18/04/2006 16:14:55
> 18/04/2006 16:16:55
> 18/04/2006 16:18:54
> 18/04/2006 16:23:00
> 18/04/2006 16:26:00
> 18/04/2006 16:31:01
> 18/04/2006 16:35:03
> 18/04/2006 16:37:05
> 18/04/2006 16:39:04
> 18/04/2006 16:41:06
> 18/04/2006 16:43:12
> 18/04/2006 16:45:10
> 18/04/2006 16:50:09
> As you can see the session data is dropped usually under 10 minutes but
> completely randomly. We have also found that the session id stays the
> same. I
> assume the reason it does stay the same is because that specific data is
> held
> on the client and passed to the server on every communication to the
> server.
> Our webhosting does not support Stateserver or SQLServer state management,
> so the only option is InProc. From searching several articles we have
> found
> there are many reasons why this data can be lost. For example if any
> .config
> files or bin files are changed or touched (eg by AV software) then the
> application resets and therefore loses the session data. This has also
> been
> tested by us and can confirm this happens.
> As our website is hosted on a shared server, we assume that other sites
> are
> or could be having similar issues as us.
> Has anyone experienced this particular issue before?
> Thanks in advance.
> Regards
> Sarah Marriott.
Hi Jeff,
Sorry for the late reply - you know how ISPs are at getting back to you :)
We asked the questions, and they stated that AV doesn't actually run on
their webservers.
Any other ideas?
Regards
Sarah
"Jeff Dillon" wrote:

> Tell your ISP to turn off the AV check.
> "Sarah Marriott" <Sarah Marriott@.discussions.microsoft.com> wrote in messa
ge
> news:11DF6E98-DF76-4995-90D4-D594FDADC120@.microsoft.com...
>
>
I've been having strange problems for the past month, since going live
with a new site. (http://www.paintworldinc.com) At first I thought
these were user errors. As traffic has been steadily increasing, so
have these errors. They are EXACTLY as you describe. Sometimes, a user
will get as far as the checkout page, populate the form, then hit the
submit - that's when the system will throw an exception. I have code in
place to catch these errors, and write the exception.message text to
the database. They have been due to trying to insert a null into a
required database field - this is data that was held in a session
variable.
I was going to use persistent state - but my host provider does not yet
support it, although they might be turning this on as I write.
Aside from that, I may just implement my own custom session variable
store - using SQL Server as my storage.
If you solve this, please post back as to your own solution.
Regards,
-DG
Sarah Marriott wrote:
> Our website contains session variables that are used to validate if a user
is
> logged in etc. We have found that these variables are randomly lost while
> navigating the website.
> We set up some basic code (as shown below) which used a meta tag to refres
h
> an aspx page every second. It tests whether there is any content in a
> session variable, if not then it writes a timestamp to a text file, recrea
tes
> the data in the variable and continues. As you can see this script contain
s
> no databases calls etc.
> <%response.write(session("Username") & "<br>" & Session.SessionID)
> if len(session("Username"))=0 then
> Dim FILENAME as String = Server.MapPath("Output.txt")
> Dim objStreamWriter as StreamWriter
> objStreamWriter = File.AppendText(FILENAME)
> objStreamWriter.WriteLine(DateTime.Now.ToString())
> objStreamWriter.Close()
> session("Username") = "HelloWorld"
> end if %>
> The output looks like this:
> 18/04/2006 15:08:18
> 18/04/2006 15:11:37
> 18/04/2006 15:18:39
> 18/04/2006 15:21:40
> 18/04/2006 15:31:41
> 18/04/2006 15:34:43
> 18/04/2006 15:41:44
> 18/04/2006 15:50:46
> 18/04/2006 15:56:49
> 18/04/2006 15:58:47
> 18/04/2006 16:03:50
> 18/04/2006 16:06:49
> 18/04/2006 16:08:49
> 18/04/2006 16:11:50
> 18/04/2006 16:14:55
> 18/04/2006 16:16:55
> 18/04/2006 16:18:54
> 18/04/2006 16:23:00
> 18/04/2006 16:26:00
> 18/04/2006 16:31:01
> 18/04/2006 16:35:03
> 18/04/2006 16:37:05
> 18/04/2006 16:39:04
> 18/04/2006 16:41:06
> 18/04/2006 16:43:12
> 18/04/2006 16:45:10
> 18/04/2006 16:50:09
> As you can see the session data is dropped usually under 10 minutes but
> completely randomly. We have also found that the session id stays the same
. I
> assume the reason it does stay the same is because that specific data is h
eld
> on the client and passed to the server on every communication to the serve
r.
> Our webhosting does not support Stateserver or SQLServer state management,
> so the only option is InProc. From searching several articles we have foun
d
> there are many reasons why this data can be lost. For example if any .conf
ig
> files or bin files are changed or touched (eg by AV software) then the
> application resets and therefore loses the session data. This has also bee
n
> tested by us and can confirm this happens.
> As our website is hosted on a shared server, we assume that other sites ar
e
> or could be having similar issues as us.
> Has anyone experienced this particular issue before?
> Thanks in advance.
> Regards
> Sarah Marriott.
Hi,
Our ISP finally got back to us saying that this problem is due to our site
being held on a Server Farm. There is nothing they will do to resolve this
issue. So we have had to handle it by storing a flag in the db which the cod
e
checks if there is no session data available. If the flag has been set then
it re-establishes the session data. This is tedious and does result in more
calls to the db, but the site is more stable.
I'm guessing that you'll have to implement something similar or use the db
like you say.
This is rather annoying and I'm surprised more people are not complaining
about it. Maybe many people do not realise this is happening - scary!
Hope this helps.
Best regards,
Sarah
"dfgallucci@.gmail.com" wrote:

> I've been having strange problems for the past month, since going live
> with a new site. (http://www.paintworldinc.com) At first I thought
> these were user errors. As traffic has been steadily increasing, so
> have these errors. They are EXACTLY as you describe. Sometimes, a user
> will get as far as the checkout page, populate the form, then hit the
> submit - that's when the system will throw an exception. I have code in
> place to catch these errors, and write the exception.message text to
> the database. They have been due to trying to insert a null into a
> required database field - this is data that was held in a session
> variable.
> I was going to use persistent state - but my host provider does not yet
> support it, although they might be turning this on as I write.
> Aside from that, I may just implement my own custom session variable
> store - using SQL Server as my storage.
> If you solve this, please post back as to your own solution.
> Regards,
> -DG
>
> Sarah Marriott wrote:
>

Session variable data being lost

Our website contains session variables that are used to validate if a user is
logged in etc. We have found that these variables are randomly lost while
navigating the website.

We set up some basic code (as shown below) which used a meta tag to refresh
an aspx page every second. It tests whether there is any content in a
session variable, if not then it writes a timestamp to a text file, recreates
the data in the variable and continues. As you can see this script contains
no databases calls etc.

<%response.write(session("Username") & "<br>" & Session.SessionID)
if len(session("Username"))=0 then
Dim FILENAME as String = Server.MapPath("Output.txt")
Dim objStreamWriter as StreamWriter
objStreamWriter = File.AppendText(FILENAME)
objStreamWriter.WriteLine(DateTime.Now.ToString())
objStreamWriter.Close()
session("Username") = "HelloWorld"
end if %
The output looks like this:
18/04/2006 15:08:18
18/04/2006 15:11:37
18/04/2006 15:18:39
18/04/2006 15:21:40
18/04/2006 15:31:41
18/04/2006 15:34:43
18/04/2006 15:41:44
18/04/2006 15:50:46
18/04/2006 15:56:49
18/04/2006 15:58:47
18/04/2006 16:03:50
18/04/2006 16:06:49
18/04/2006 16:08:49
18/04/2006 16:11:50
18/04/2006 16:14:55
18/04/2006 16:16:55
18/04/2006 16:18:54
18/04/2006 16:23:00
18/04/2006 16:26:00
18/04/2006 16:31:01
18/04/2006 16:35:03
18/04/2006 16:37:05
18/04/2006 16:39:04
18/04/2006 16:41:06
18/04/2006 16:43:12
18/04/2006 16:45:10
18/04/2006 16:50:09

As you can see the session data is dropped usually under 10 minutes but
completely randomly. We have also found that the session id stays the same. I
assume the reason it does stay the same is because that specific data is held
on the client and passed to the server on every communication to the server.

Our webhosting does not support Stateserver or SQLServer state management,
so the only option is InProc. From searching several articles we have found
there are many reasons why this data can be lost. For example if any .config
files or bin files are changed or touched (eg by AV software) then the
application resets and therefore loses the session data. This has also been
tested by us and can confirm this happens.

As our website is hosted on a shared server, we assume that other sites are
or could be having similar issues as us.

Has anyone experienced this particular issue before?

Thanks in advance.

Regards

Sarah Marriott.Tell your ISP to turn off the AV check.

"Sarah Marriott" <Sarah Marriott@.discussions.microsoft.com> wrote in message
news:11DF6E98-DF76-4995-90D4-D594FDADC120@.microsoft.com...
> Our website contains session variables that are used to validate if a user
> is
> logged in etc. We have found that these variables are randomly lost while
> navigating the website.
> We set up some basic code (as shown below) which used a meta tag to
> refresh
> an aspx page every second. It tests whether there is any content in a
> session variable, if not then it writes a timestamp to a text file,
> recreates
> the data in the variable and continues. As you can see this script
> contains
> no databases calls etc.
> <%response.write(session("Username") & "<br>" & Session.SessionID)
> if len(session("Username"))=0 then
> Dim FILENAME as String = Server.MapPath("Output.txt")
> Dim objStreamWriter as StreamWriter
> objStreamWriter = File.AppendText(FILENAME)
> objStreamWriter.WriteLine(DateTime.Now.ToString())
> objStreamWriter.Close()
> session("Username") = "HelloWorld"
> end if %>
> The output looks like this:
> 18/04/2006 15:08:18
> 18/04/2006 15:11:37
> 18/04/2006 15:18:39
> 18/04/2006 15:21:40
> 18/04/2006 15:31:41
> 18/04/2006 15:34:43
> 18/04/2006 15:41:44
> 18/04/2006 15:50:46
> 18/04/2006 15:56:49
> 18/04/2006 15:58:47
> 18/04/2006 16:03:50
> 18/04/2006 16:06:49
> 18/04/2006 16:08:49
> 18/04/2006 16:11:50
> 18/04/2006 16:14:55
> 18/04/2006 16:16:55
> 18/04/2006 16:18:54
> 18/04/2006 16:23:00
> 18/04/2006 16:26:00
> 18/04/2006 16:31:01
> 18/04/2006 16:35:03
> 18/04/2006 16:37:05
> 18/04/2006 16:39:04
> 18/04/2006 16:41:06
> 18/04/2006 16:43:12
> 18/04/2006 16:45:10
> 18/04/2006 16:50:09
> As you can see the session data is dropped usually under 10 minutes but
> completely randomly. We have also found that the session id stays the
> same. I
> assume the reason it does stay the same is because that specific data is
> held
> on the client and passed to the server on every communication to the
> server.
> Our webhosting does not support Stateserver or SQLServer state management,
> so the only option is InProc. From searching several articles we have
> found
> there are many reasons why this data can be lost. For example if any
> .config
> files or bin files are changed or touched (eg by AV software) then the
> application resets and therefore loses the session data. This has also
> been
> tested by us and can confirm this happens.
> As our website is hosted on a shared server, we assume that other sites
> are
> or could be having similar issues as us.
> Has anyone experienced this particular issue before?
> Thanks in advance.
> Regards
> Sarah Marriott.
Hi Jeff,

Sorry for the late reply - you know how ISPs are at getting back to you :)

We asked the questions, and they stated that AV doesn't actually run on
their webservers.

Any other ideas?

Regards

Sarah

"Jeff Dillon" wrote:

> Tell your ISP to turn off the AV check.
> "Sarah Marriott" <Sarah Marriott@.discussions.microsoft.com> wrote in message
> news:11DF6E98-DF76-4995-90D4-D594FDADC120@.microsoft.com...
> > Our website contains session variables that are used to validate if a user
> > is
> > logged in etc. We have found that these variables are randomly lost while
> > navigating the website.
> > We set up some basic code (as shown below) which used a meta tag to
> > refresh
> > an aspx page every second. It tests whether there is any content in a
> > session variable, if not then it writes a timestamp to a text file,
> > recreates
> > the data in the variable and continues. As you can see this script
> > contains
> > no databases calls etc.
> > <%response.write(session("Username") & "<br>" & Session.SessionID)
> > if len(session("Username"))=0 then
> > Dim FILENAME as String = Server.MapPath("Output.txt")
> > Dim objStreamWriter as StreamWriter
> > objStreamWriter = File.AppendText(FILENAME)
> > objStreamWriter.WriteLine(DateTime.Now.ToString())
> > objStreamWriter.Close()
> > session("Username") = "HelloWorld"
> > end if %>
> > The output looks like this:
> > 18/04/2006 15:08:18
> > 18/04/2006 15:11:37
> > 18/04/2006 15:18:39
> > 18/04/2006 15:21:40
> > 18/04/2006 15:31:41
> > 18/04/2006 15:34:43
> > 18/04/2006 15:41:44
> > 18/04/2006 15:50:46
> > 18/04/2006 15:56:49
> > 18/04/2006 15:58:47
> > 18/04/2006 16:03:50
> > 18/04/2006 16:06:49
> > 18/04/2006 16:08:49
> > 18/04/2006 16:11:50
> > 18/04/2006 16:14:55
> > 18/04/2006 16:16:55
> > 18/04/2006 16:18:54
> > 18/04/2006 16:23:00
> > 18/04/2006 16:26:00
> > 18/04/2006 16:31:01
> > 18/04/2006 16:35:03
> > 18/04/2006 16:37:05
> > 18/04/2006 16:39:04
> > 18/04/2006 16:41:06
> > 18/04/2006 16:43:12
> > 18/04/2006 16:45:10
> > 18/04/2006 16:50:09
> > As you can see the session data is dropped usually under 10 minutes but
> > completely randomly. We have also found that the session id stays the
> > same. I
> > assume the reason it does stay the same is because that specific data is
> > held
> > on the client and passed to the server on every communication to the
> > server.
> > Our webhosting does not support Stateserver or SQLServer state management,
> > so the only option is InProc. From searching several articles we have
> > found
> > there are many reasons why this data can be lost. For example if any
> > .config
> > files or bin files are changed or touched (eg by AV software) then the
> > application resets and therefore loses the session data. This has also
> > been
> > tested by us and can confirm this happens.
> > As our website is hosted on a shared server, we assume that other sites
> > are
> > or could be having similar issues as us.
> > Has anyone experienced this particular issue before?
> > Thanks in advance.
> > Regards
> > Sarah Marriott.
>
I've been having strange problems for the past month, since going live
with a new site. (http://www.paintworldinc.com) At first I thought
these were user errors. As traffic has been steadily increasing, so
have these errors. They are EXACTLY as you describe. Sometimes, a user
will get as far as the checkout page, populate the form, then hit the
submit - that's when the system will throw an exception. I have code in
place to catch these errors, and write the exception.message text to
the database. They have been due to trying to insert a null into a
required database field - this is data that was held in a session
variable.

I was going to use persistent state - but my host provider does not yet
support it, although they might be turning this on as I write.

Aside from that, I may just implement my own custom session variable
store - using SQL Server as my storage.

If you solve this, please post back as to your own solution.

Regards,

-DG

Sarah Marriott wrote:
> Our website contains session variables that are used to validate if a user is
> logged in etc. We have found that these variables are randomly lost while
> navigating the website.
> We set up some basic code (as shown below) which used a meta tag to refresh
> an aspx page every second. It tests whether there is any content in a
> session variable, if not then it writes a timestamp to a text file, recreates
> the data in the variable and continues. As you can see this script contains
> no databases calls etc.
> <%response.write(session("Username") & "<br>" & Session.SessionID)
> if len(session("Username"))=0 then
> Dim FILENAME as String = Server.MapPath("Output.txt")
> Dim objStreamWriter as StreamWriter
> objStreamWriter = File.AppendText(FILENAME)
> objStreamWriter.WriteLine(DateTime.Now.ToString())
> objStreamWriter.Close()
> session("Username") = "HelloWorld"
> end if %>
> The output looks like this:
> 18/04/2006 15:08:18
> 18/04/2006 15:11:37
> 18/04/2006 15:18:39
> 18/04/2006 15:21:40
> 18/04/2006 15:31:41
> 18/04/2006 15:34:43
> 18/04/2006 15:41:44
> 18/04/2006 15:50:46
> 18/04/2006 15:56:49
> 18/04/2006 15:58:47
> 18/04/2006 16:03:50
> 18/04/2006 16:06:49
> 18/04/2006 16:08:49
> 18/04/2006 16:11:50
> 18/04/2006 16:14:55
> 18/04/2006 16:16:55
> 18/04/2006 16:18:54
> 18/04/2006 16:23:00
> 18/04/2006 16:26:00
> 18/04/2006 16:31:01
> 18/04/2006 16:35:03
> 18/04/2006 16:37:05
> 18/04/2006 16:39:04
> 18/04/2006 16:41:06
> 18/04/2006 16:43:12
> 18/04/2006 16:45:10
> 18/04/2006 16:50:09
> As you can see the session data is dropped usually under 10 minutes but
> completely randomly. We have also found that the session id stays the same. I
> assume the reason it does stay the same is because that specific data is held
> on the client and passed to the server on every communication to the server.
> Our webhosting does not support Stateserver or SQLServer state management,
> so the only option is InProc. From searching several articles we have found
> there are many reasons why this data can be lost. For example if any .config
> files or bin files are changed or touched (eg by AV software) then the
> application resets and therefore loses the session data. This has also been
> tested by us and can confirm this happens.
> As our website is hosted on a shared server, we assume that other sites are
> or could be having similar issues as us.
> Has anyone experienced this particular issue before?
> Thanks in advance.
> Regards
> Sarah Marriott.
Hi,

Our ISP finally got back to us saying that this problem is due to our site
being held on a Server Farm. There is nothing they will do to resolve this
issue. So we have had to handle it by storing a flag in the db which the code
checks if there is no session data available. If the flag has been set then
it re-establishes the session data. This is tedious and does result in more
calls to the db, but the site is more stable.

I'm guessing that you'll have to implement something similar or use the db
like you say.

This is rather annoying and I'm surprised more people are not complaining
about it. Maybe many people do not realise this is happening - scary!

Hope this helps.

Best regards,

Sarah

"dfgallucci@.gmail.com" wrote:

> I've been having strange problems for the past month, since going live
> with a new site. (http://www.paintworldinc.com) At first I thought
> these were user errors. As traffic has been steadily increasing, so
> have these errors. They are EXACTLY as you describe. Sometimes, a user
> will get as far as the checkout page, populate the form, then hit the
> submit - that's when the system will throw an exception. I have code in
> place to catch these errors, and write the exception.message text to
> the database. They have been due to trying to insert a null into a
> required database field - this is data that was held in a session
> variable.
> I was going to use persistent state - but my host provider does not yet
> support it, although they might be turning this on as I write.
> Aside from that, I may just implement my own custom session variable
> store - using SQL Server as my storage.
> If you solve this, please post back as to your own solution.
> Regards,
> -DG
>
> Sarah Marriott wrote:
> > Our website contains session variables that are used to validate if a user is
> > logged in etc. We have found that these variables are randomly lost while
> > navigating the website.
> > We set up some basic code (as shown below) which used a meta tag to refresh
> > an aspx page every second. It tests whether there is any content in a
> > session variable, if not then it writes a timestamp to a text file, recreates
> > the data in the variable and continues. As you can see this script contains
> > no databases calls etc.
> > <%response.write(session("Username") & "<br>" & Session.SessionID)
> > if len(session("Username"))=0 then
> > Dim FILENAME as String = Server.MapPath("Output.txt")
> > Dim objStreamWriter as StreamWriter
> > objStreamWriter = File.AppendText(FILENAME)
> > objStreamWriter.WriteLine(DateTime.Now.ToString())
> > objStreamWriter.Close()
> > session("Username") = "HelloWorld"
> > end if %>
> > The output looks like this:
> > 18/04/2006 15:08:18
> > 18/04/2006 15:11:37
> > 18/04/2006 15:18:39
> > 18/04/2006 15:21:40
> > 18/04/2006 15:31:41
> > 18/04/2006 15:34:43
> > 18/04/2006 15:41:44
> > 18/04/2006 15:50:46
> > 18/04/2006 15:56:49
> > 18/04/2006 15:58:47
> > 18/04/2006 16:03:50
> > 18/04/2006 16:06:49
> > 18/04/2006 16:08:49
> > 18/04/2006 16:11:50
> > 18/04/2006 16:14:55
> > 18/04/2006 16:16:55
> > 18/04/2006 16:18:54
> > 18/04/2006 16:23:00
> > 18/04/2006 16:26:00
> > 18/04/2006 16:31:01
> > 18/04/2006 16:35:03
> > 18/04/2006 16:37:05
> > 18/04/2006 16:39:04
> > 18/04/2006 16:41:06
> > 18/04/2006 16:43:12
> > 18/04/2006 16:45:10
> > 18/04/2006 16:50:09
> > As you can see the session data is dropped usually under 10 minutes but
> > completely randomly. We have also found that the session id stays the same. I
> > assume the reason it does stay the same is because that specific data is held
> > on the client and passed to the server on every communication to the server.
> > Our webhosting does not support Stateserver or SQLServer state management,
> > so the only option is InProc. From searching several articles we have found
> > there are many reasons why this data can be lost. For example if any .config
> > files or bin files are changed or touched (eg by AV software) then the
> > application resets and therefore loses the session data. This has also been
> > tested by us and can confirm this happens.
> > As our website is hosted on a shared server, we assume that other sites are
> > or could be having similar issues as us.
> > Has anyone experienced this particular issue before?
> > Thanks in advance.
> > Regards
> > Sarah Marriott.
>

session variable expire too quickly

Hi all
when i log onto my asp.net website through a browser , the session variables
are expiring way too quickly. if i leave the screen for only a minute,
everything is gone.
it seems like some pages are worse than others...
the session timeout is set to 20mins, but still they are expiring after only
a minute...
what should i do'
--
AdamPC@dotnet.itags.org.hotmail.comread my resonse to the first post you made on this one... lots of stuff out
there.
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"ACaunter" <AdamPC@.hotmail.com> wrote in message
news:73D329BF-E42C-465A-B9BF-864327266347@.microsoft.com...
> Hi all
> when i log onto my asp.net website through a browser , the session
> variables
> are expiring way too quickly. if i leave the screen for only a minute,
> everything is gone.
> it seems like some pages are worse than others...
> the session timeout is set to 20mins, but still they are expiring after
> only
> a minute...
> what should i do'
> --
> AdamPC@.hotmail.com

session variable expire too quickly

Hi all
when i log onto my asp.net website through a browser , the session variables
are expiring way too quickly. if i leave the screen for only a minute,
everything is gone.
it seems like some pages are worse than others...
the session timeout is set to 20mins, but still they are expiring after only
a minute...

what should i do??
--
AdamPC@dotnet.itags.org.hotmail.comread my resonse to the first post you made on this one... lots of stuff out
there.

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com

"ACaunter" <AdamPC@.hotmail.com> wrote in message
news:73D329BF-E42C-465A-B9BF-864327266347@.microsoft.com...
> Hi all
> when i log onto my asp.net website through a browser , the session
> variables
> are expiring way too quickly. if i leave the screen for only a minute,
> everything is gone.
> it seems like some pages are worse than others...
> the session timeout is set to 20mins, but still they are expiring after
> only
> a minute...
> what should i do??
> --
> AdamPC@.hotmail.com

Thursday, March 22, 2012

Session Variables

I have a website I wrote where I store information that I need from page to page in session variables. I set the variable in the global.aspx to "". Then in my code I simply reference it like: Session("CheckType") = "DIRECT"

Now would anyone know why this would sometimes not keep? Some of my session variables work fine and keep their values from page to page. There is one however where I can assign a value on one page for it and it never keeps, so when I reference the value on another page it doesn't work. Ideas?

Thanks!It won't stay in memory if the session times out. Is that what's happening?

Session variables

Hi,

Is there any know problem using session variables ?
My website won't have more than 20 simultaneous connections, and i would
like to use 5 session variables containing strings...
I know than with ASP, it was not really recommended, what about ASP.NET ?

Thanks !There's nothing wrong with using them, but there are better alternatives.

"Gerald" <antispam@.nospam.com> wrote in message
news:esPTPKcJFHA.1476@.TK2MSFTNGP09.phx.gbl...
> Hi,
> Is there any know problem using session variables ?
> My website won't have more than 20 simultaneous connections, and i would
> like to use 5 session variables containing strings...
> I know than with ASP, it was not really recommended, what about ASP.NET ?
> Thanks !
Nothing wrong with them in ASP and there is nothing wrong with them in
ASP.NET.
Particularly value types like strings and ints.

--
2005 Microsoft MVP C#
Robbe Morris
http://www.robbemorris.com
http://www.masterado.net/home/listings.aspx

"Gerald" <antispam@.nospam.com> wrote in message
news:esPTPKcJFHA.1476@.TK2MSFTNGP09.phx.gbl...
> Hi,
> Is there any know problem using session variables ?
> My website won't have more than 20 simultaneous connections, and i would
> like to use 5 session variables containing strings...
> I know than with ASP, it was not really recommended, what about ASP.NET ?
> Thanks !
Thanks, wich alternatives are better ?
"Gerald" wrote:

> Hi,
> Is there any know problem using session variables ?
> My website won't have more than 20 simultaneous connections, and i would
> like to use 5 session variables containing strings...
> I know than with ASP, it was not really recommended, what about ASP.NET ?
> Thanks !

Hi, i wouldnt call them problems, theres just stuff to be aware of. Like if
your site is spread across a web farm, youll need to use an out-of-process
session state instead of in-process. Also if that server gets rebooted then
ppl will lose their session state. But if theres only going to be 20 users
and 1 web server then there shouldnt otherwise be any real negatives to using
session state, as long as that server isnt running w/ 128MB of RAM!

HTH
Writing to a database, rather than saving per-user values in memory and
potentially needing to save huge amounts of data in RAM.

Using cookies for non-critical application data.

"Gerald" <antispam@.nospam.com> wrote in message
news:udfVSEiJFHA.1176@.TK2MSFTNGP15.phx.gbl...
> Thanks, wich alternatives are better ?
Hello Scott M.,

At which point you're just offloading the bottleneck, right? Writing to/reading
from a database is one of the most expensive operations you can perform.

The true answer here is that Session variables used judiciously are ok. Issues
will come up if you do things such as storing every little detail in Session
or need to have session access across a web farm.

--
Matt Berther
http://www.mattberther.com

> Writing to a database, rather than saving per-user values in memory
> and potentially needing to save huge amounts of data in RAM.
> Using cookies for non-critical application data.
> "Gerald" <antispam@.nospam.com> wrote in message
> news:udfVSEiJFHA.1176@.TK2MSFTNGP15.phx.gbl...
>> Thanks, wich alternatives are better ?
>
Reading/Writing to a DB is not the CPU and bandwidth hog that it once was.
This solution is widely considered to be the most stable and robust way to
persist state.

Now, should it be used to store short-term data or for every piece of data
needing to be persisted? No, and I never said it should be. I only said
that there are better alternatives to sessions (which, by the way, may not
even be an option since many web server admins turn off the server's ability
to use sessions because of the tendency to over use them or use them
incorrectly).

The *true* answer is that there is no one solution. The best sites use a
bit of several techniques where it makes sense to do so. I love using
cookies because it "off-loads" the storage to the client. But, as you know,
cookies can be turned off at the client level (as well as them being
susceptible to corruption). So, I only use them for non-critical data
storage like storing a user's preferences.

Sessions are easy enough to use, but can cause serious memory issues on the
server (even if they are used sparingly in code). Additionally, when a
client turns off cookies, they may also be turning of "per session cookies"
which means that server sessions are effectively turned off as well. Not to
mention the issues that come up with the use of sessions in web farm
environments.

Hidden form fields and querystrings are other ways to move data around but
they are also susceptible to corruption and querystrings in particular have
limits on the amount of data that can be passed.

So now we come to database storage...This can not be turned off by the
client, so it is reliable. There are no practical limits on the amount of
data that can be stored. Web Farm situations don't impact their use. The
possibilities of data loss due to a server crashing are eliminated, etc.,
etc., etc. Because we live in a world with faster servers and higher
bandwidth that ever before, using a database for persisting data is not the
taboo that it once was. Today, it is widely considered to be the "only"
choice by many serious web developers.

"Matt Berther" <mberther@.hotmail.com> wrote in message
news:221a09c788fc088c6f4899b20247d@.news.microsoft. com...
> Hello Scott M.,
> At which point you're just offloading the bottleneck, right? Writing
> to/reading from a database is one of the most expensive operations you can
> perform.
> The true answer here is that Session variables used judiciously are ok.
> Issues will come up if you do things such as storing every little detail
> in Session or need to have session access across a web farm.
> --
> Matt Berther
> http://www.mattberther.com
>> Writing to a database, rather than saving per-user values in memory
>> and potentially needing to save huge amounts of data in RAM.
>>
>> Using cookies for non-critical application data.
>>
>> "Gerald" <antispam@.nospam.com> wrote in message
>> news:udfVSEiJFHA.1176@.TK2MSFTNGP15.phx.gbl...
>>
>>> Thanks, wich alternatives are better ?
>>>

Session variables

Hi,
Is there any know problem using session variables ?
My website won't have more than 20 simultaneous connections, and i would
like to use 5 session variables containing strings...
I know than with ASP, it was not really recommended, what about ASP.NET ?
Thanks !There's nothing wrong with using them, but there are better alternatives.
"Gerald" <antispam@.nospam.com> wrote in message
news:esPTPKcJFHA.1476@.TK2MSFTNGP09.phx.gbl...
> Hi,
> Is there any know problem using session variables ?
> My website won't have more than 20 simultaneous connections, and i would
> like to use 5 session variables containing strings...
> I know than with ASP, it was not really recommended, what about ASP.NET ?
> Thanks !
>
Nothing wrong with them in ASP and there is nothing wrong with them in
ASP.NET.
Particularly value types like strings and ints.
2005 Microsoft MVP C#
Robbe Morris
http://www.robbemorris.com
http://www.masterado.net/home/listings.aspx
"Gerald" <antispam@.nospam.com> wrote in message
news:esPTPKcJFHA.1476@.TK2MSFTNGP09.phx.gbl...
> Hi,
> Is there any know problem using session variables ?
> My website won't have more than 20 simultaneous connections, and i would
> like to use 5 session variables containing strings...
> I know than with ASP, it was not really recommended, what about ASP.NET ?
> Thanks !
>
Thanks, wich alternatives are better ?
"Gerald" wrote:

> Hi,
> Is there any know problem using session variables ?
> My website won't have more than 20 simultaneous connections, and i would
> like to use 5 session variables containing strings...
> I know than with ASP, it was not really recommended, what about ASP.NET ?
> Thanks !
Hi, i wouldnt call them problems, theres just stuff to be aware of. Like if
your site is spread across a web farm, youll need to use an out-of-process
session state instead of in-process. Also if that server gets rebooted the
n
ppl will lose their session state. But if theres only going to be 20 users
and 1 web server then there shouldnt otherwise be any real negatives to usin
g
session state, as long as that server isnt running w/ 128MB of RAM!
HTH
Writing to a database, rather than saving per-user values in memory and
potentially needing to save huge amounts of data in RAM.
Using cookies for non-critical application data.
"Gerald" <antispam@.nospam.com> wrote in message
news:udfVSEiJFHA.1176@.TK2MSFTNGP15.phx.gbl...
> Thanks, wich alternatives are better ?
>
Hello Scott M.,
At which point you're just offloading the bottleneck, right? Writing to/read
ing
from a database is one of the most expensive operations you can perform.
The true answer here is that Session variables used judiciously are ok. Issu
es
will come up if you do things such as storing every little detail in Session
or need to have session access across a web farm.
Matt Berther
http://www.mattberther.com
> Writing to a database, rather than saving per-user values in memory
> and potentially needing to save huge amounts of data in RAM.
> Using cookies for non-critical application data.
> "Gerald" <antispam@.nospam.com> wrote in message
> news:udfVSEiJFHA.1176@.TK2MSFTNGP15.phx.gbl...
>
Reading/Writing to a DB is not the CPU and bandwidth hog that it once was.
This solution is widely considered to be the most stable and robust way to
persist state.
Now, should it be used to store short-term data or for every piece of data
needing to be persisted? No, and I never said it should be. I only said
that there are better alternatives to sessions (which, by the way, may not
even be an option since many web server admins turn off the server's ability
to use sessions because of the tendency to over use them or use them
incorrectly).
The *true* answer is that there is no one solution. The best sites use a
bit of several techniques where it makes sense to do so. I love using
cookies because it "off-loads" the storage to the client. But, as you know,
cookies can be turned off at the client level (as well as them being
susceptible to corruption). So, I only use them for non-critical data
storage like storing a user's preferences.
Sessions are easy enough to use, but can cause serious memory issues on the
server (even if they are used sparingly in code). Additionally, when a
client turns off cookies, they may also be turning of "per session cookies"
which means that server sessions are effectively turned off as well. Not to
mention the issues that come up with the use of sessions in web farm
environments.
Hidden form fields and querystrings are other ways to move data around but
they are also susceptible to corruption and querystrings in particular have
limits on the amount of data that can be passed.
So now we come to database storage...This can not be turned off by the
client, so it is reliable. There are no practical limits on the amount of
data that can be stored. Web Farm situations don't impact their use. The
possibilities of data loss due to a server crashing are eliminated, etc.,
etc., etc. Because we live in a world with faster servers and higher
bandwidth that ever before, using a database for persisting data is not the
taboo that it once was. Today, it is widely considered to be the "only"
choice by many serious web developers.
"Matt Berther" <mberther@.hotmail.com> wrote in message
news:221a09c788fc088c6f4899b20247d@.news.microsoft.com...
> Hello Scott M.,
> At which point you're just offloading the bottleneck, right? Writing
> to/reading from a database is one of the most expensive operations you can
> perform.
> The true answer here is that Session variables used judiciously are ok.
> Issues will come up if you do things such as storing every little detail
> in Session or need to have session access across a web farm.
> --
> Matt Berther
> http://www.mattberther.com
>
>
>

Session variables

Hi,
Is there any inconvenient using session variables (about 10, containing
string), for a website having about 100 simultaneous users ?
Thanks for your opinion !"Marine" <none@.none.org> wrote in message
news:eTeoALWJIHA.4684@.TK2MSFTNGP06.phx.gbl...

> Is there any inconvenient using session variables (about 10, containing
> string), for a website having about 100 simultaneous users ?
IMO, no...
Mark Rae
ASP.NET MVP
http://www.markrae.net
That's a pretty frugal use. ( 100 x 10 )
My only comment would be... do these values have anything in common?
Or are they disjoint?
If some of them are in common...then you might want to create a small
wrapper object, and put that into the session, instead of a bunch of
disjoint values.
public class EmployeeStuff
string FavoriteColor (encapsulated as a property)
string JobTitle(encapsulated as a property)
string CubicleNumber (encapsulated as a property)
Session["CurrentEmployee"] = new EmployeeStuff(); //Put an item into the
Session
EmployeeStuff es = Session["CurrentEmployee"] as EmployeeStuff;//put if out
of the Session
Create a little wrapper object (as above), and put that into session instead
of disjointed things like this:
Session["CurrentEmployeeFavoriteColor"]
Session["CurrentEmployeeJobTitle"]
Session["CurrentEmployeeCubicleNumber"]
Aka, that's kind sloppy.
Using the small wrapper class will greatly help with debugging and
maintenance.
You can check this out as well:
http://sholliday.spaces.live.com/Blog/cns!A68482B9628A842A!151.entry
"Marine" <none@.none.org> wrote in message
news:eTeoALWJIHA.4684@.TK2MSFTNGP06.phx.gbl...
> Hi,
> Is there any inconvenient using session variables (about 10, containing
> string), for a website having about 100 simultaneous users ?
> Thanks for your opinion !
>
It depends on how big the string are and how much RAM you have.
It can be a problem, but again depends.
Wrapping in one object might be less overhead?
"Marine" <none@.none.org> wrote in message
news:eTeoALWJIHA.4684@.TK2MSFTNGP06.phx.gbl...
> Hi,
> Is there any inconvenient using session variables (about 10, containing
> string), for a website having about 100 simultaneous users ?
> Thanks for your opinion !
>

Session variables

Hi,

Is there any inconvenient using session variables (about 10, containing
string), for a website having about 100 simultaneous users ?

Thanks for your opinion !"Marine" <none@.none.orgwrote in message
news:eTeoALWJIHA.4684@.TK2MSFTNGP06.phx.gbl...

Quote:

Originally Posted by

Is there any inconvenient using session variables (about 10, containing
string), for a website having about 100 simultaneous users ?


IMO, no...

--
Mark Rae
ASP.NET MVP
http://www.markrae.net
It depends on how big the string are and how much RAM you have.
It can be a problem, but again depends.

Wrapping in one object might be less overhead?

"Marine" <none@.none.orgwrote in message
news:eTeoALWJIHA.4684@.TK2MSFTNGP06.phx.gbl...

Quote:

Originally Posted by

Hi,
>
Is there any inconvenient using session variables (about 10, containing
string), for a website having about 100 simultaneous users ?
>
Thanks for your opinion !
>
>

Tuesday, March 13, 2012

Session variables from nonsecure to secure servers

Hi,

I am working on a website that is adding ecommerce to it. This is a community site where members login and post, with the option of paying for extra services.

When I put the user to "upgrade" page, they are no longer logged in as they were previously. I need to have the user logged in so I know which account to upgrade.

Whats the standard method of doing this ?

Thanks alot
mike123Hi Mike,

You can use cookies to store the login name for user and read that cookie from your secure end.

HTH
That simple eh? Any other options ?

A site I am attempting to model after does it without the use of a cookie :S

Any idea how ?
how about this...

Encrypt the userid in querysting and pass it to your secure page.. where you can decrypt it.

HTH
Hi Longhorn2005,

Sounds like a great idea. Where can I find some example code on how to do that? Any ideas?

Thanks again,
mike123
Hi Mike,

you might wanna have a look at thispost

HTH