Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > delayed session creation

Reply
Thread Tools

delayed session creation

 
 
George
Guest
Posts: n/a
 
      06-17-2005
Hi, Is it possible to delay session creation in ASP.NET

I want the user to browse my site without any session created (no cookies set). My pages will know that is Session = null then Session has not been created and they should not rely on it.

But at the moment user puts something into shopping cart i want to trigger session creation (set the cookies) and from no own that user will have regular session.

Is it doable with .NET Session or i will have to create my own Session object?


Thanks
George.
 
Reply With Quote
 
 
 
 
Kevin Spencer
Guest
Posts: n/a
 
      06-17-2005
Hi George,

Session is always there. Think of it as a box. It doesn't have anything IN
it until you PUT something in it. In addition, Session cookies are not saved
as a file on the client machine. They exist (in memory) only for the
lifetime of the client Session on your web site. They expire immediately.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.

"George" <(E-Mail Removed)> wrote in message
news:uis8$(E-Mail Removed)...
Hi, Is it possible to delay session creation in ASP.NET

I want the user to browse my site without any session created (no cookies
set). My pages will know that is Session = null then Session has not been
created and they should not rely on it.

But at the moment user puts something into shopping cart i want to trigger
session creation (set the cookies) and from no own that user will have
regular session.

Is it doable with .NET Session or i will have to create my own Session
object?


Thanks
George.


 
Reply With Quote
 
 
 
 
George
Guest
Posts: n/a
 
      06-17-2005
You misunderstood me,
I am very well aware how session works.

I do not want it to be created since it eats memory in my server and any malicious code hitting my box 1000 times a second will bring it down because my memory will be full of empty Sessions (boxes as you said)

All i want is somehow postpone the Session creation untill i need it( basically user want to put something into shopping cart).

All is needed is that ASP did not create session automaticly and sent the cookie back to the computer.
So the question is how can i do it with ASP.NET

PS: I always can have my custom Session object created and have on every page EnableSessionState = false. But i would rather use Session from ASP.NET

George.

"Kevin Spencer" <(E-Mail Removed)> wrote in message news:OxA$(E-Mail Removed)...
Hi George,

Session is always there. Think of it as a box. It doesn't have anything IN
it until you PUT something in it. In addition, Session cookies are not saved
as a file on the client machine. They exist (in memory) only for the
lifetime of the client Session on your web site. They expire immediately.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
Ambiguity has a certain quality to it.

"George" <(E-Mail Removed)> wrote in message
news:uis8$(E-Mail Removed)...
Hi, Is it possible to delay session creation in ASP.NET

I want the user to browse my site without any session created (no cookies
set). My pages will know that is Session = null then Session has not been
created and they should not rely on it.

But at the moment user puts something into shopping cart i want to trigger
session creation (set the cookies) and from no own that user will have
regular session.

Is it doable with .NET Session or i will have to create my own Session
object?


Thanks
George.


 
Reply With Quote
 
Bruce Barker
Guest
Posts: n/a
 
      06-17-2005
this is not builtin. you need to write your own, or as a hack, on end request call session.abandon(), whenever you don't want to keep the session (just put a keep flag in the session). this will keep the memory footprint down.

but if you are doing a true shopping cart app, i would not use inproc sessions (too easy to the lose cart). i'd use a database and allow the cart to survive for days.


-- bruce (sqlwork.com)

"George" <(E-Mail Removed)> wrote in message news:uis8$(E-Mail Removed)...
Hi, Is it possible to delay session creation in ASP.NET

I want the user to browse my site without any session created (no cookies set). My pages will know that is Session = null then Session has not been created and they should not rely on it.

But at the moment user puts something into shopping cart i want to trigger session creation (set the cookies) and from no own that user will have regular session.

Is it doable with .NET Session or i will have to create my own Session object?


Thanks
George.
 
Reply With Quote
 
Tom.PesterDELETETHISSS@pandora.be
Guest
Posts: n/a
 
      06-17-2005
Hi,

Is this realy an issue? Do you have an idea of the memory sessions consume
that don't get used?

I haven't encountered a problem with this but I dont have 1000's of visitors.

Cheers,
Tom Pester

> Hi, Is it possible to delay session creation in ASP.NET
>
> I want the user to browse my site without any session created (no
> cookies set). My pages will know that is Session = null then Session
> has not been created and they should not rely on it.
>
> But at the moment user puts something into shopping cart i want to
> trigger session creation (set the cookies) and from no own that user
> will have regular session.
>
> Is it doable with .NET Session or i will have to create my own Session
> object?
>
> Thanks
> George.



 
Reply With Quote
 
Juan T. Llibre
Guest
Posts: n/a
 
      06-18-2005
re:
>PS: I always can have my custom Session object created
>and have on every page EnableSessionState = false.


You answered your own question.

Disable SessionState on all the initial pages,
and enable SessionState at the point you want to.

You could also have an entry point in an application which
uses cookieless mode, and redirect to a cookie-enabled
application when you need it.




Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Espanol
Ven, y hablemos de ASP.NET...
======================

"George" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
You misunderstood me,
I am very well aware how session works.

I do not want it to be created since it eats memory in my server and any malicious code
hitting my box 1000 times a second will bring it down because my memory will be full of
empty Sessions (boxes as you said)

All i want is somehow postpone the Session creation untill i need it( basically user want
to put something into shopping cart).

All is needed is that ASP did not create session automaticly and sent the cookie back to
the computer.
So the question is how can i do it with ASP.NET

PS: I always can have my custom Session object created and have on every page
EnableSessionState = false. But i would rather use Session from ASP.NET

George.

"Kevin Spencer" <(E-Mail Removed)> wrote in message
news:OxA$(E-Mail Removed)...
Hi George,

Session is always there. Think of it as a box. It doesn't have anything IN
it until you PUT something in it. In addition, Session cookies are not saved
as a file on the client machine. They exist (in memory) only for the
lifetime of the client Session on your web site. They expire immediately.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
Ambiguity has a certain quality to it.

"George" <(E-Mail Removed)> wrote in message
news:uis8$(E-Mail Removed)...
Hi, Is it possible to delay session creation in ASP.NET

I want the user to browse my site without any session created (no cookies
set). My pages will know that is Session = null then Session has not been
created and they should not rely on it.

But at the moment user puts something into shopping cart i want to trigger
session creation (set the cookies) and from no own that user will have
regular session.

Is it doable with .NET Session or i will have to create my own Session
object?


Thanks
George.



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Session Timeout problems-web.confg session state and IIS session s =?Utf-8?B?Um9iSEs=?= ASP .Net 4 04-11-2007 04:52 PM
How to (batch) set EXIF date taken and IPTC creation date and creation time for photos with filenames YYMMDDHHMMSS#.jpg? guercheLE@gmail.com Digital Photography 1 10-04-2005 07:15 PM
Delayed Instantiation - delayed.rb matt Ruby 8 06-19-2004 08:08 PM
Delayed Instantiation - delayed.rb matt Ruby 1 06-17-2004 01:43 AM
Session State - What does it take to establish one single ASP.NET session per "browser session" Jeff Smythe ASP .Net 3 01-02-2004 04:10 AM



Advertisments