470,833 Members | 1,329 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,833 developers. It's quick & easy.

Session objects do not persist on different web pages... why that happens ?

Hello.
I'm rather used to include Session in my ASP classic projects and of course
once a Session has a value assigned it is possible to retrieve it from all
over the web site.

This is not happening in a C# .NET project I'm working at the time. I set a
value for 3 Sessions in a 'login' page and everything works fine (I found
out the correct contents in the tracing informations). Problem is: when the
user after authentication is redirected to the site's main page everything
disappears and even in the 'Session State' section of the tracing no session
or values are reported.

Is there an explanation for such a behaviour ? Is there a way to make
sessions genereted by a page readable from other pages in .NET ?

I thank you in advance for any help

Newcomsas
Nov 4 '08 #1
2 1763
"Newcomsas" <ne*******@hotmail.comwrote in message
news:ge**********@aioe.org...
This is not happening in a C# .NET project I'm working at the time. I set
a value for 3 Sessions in a 'login' page and everything works fine (I
found out the correct contents in the tracing informations). Problem is:
when the user after authentication is redirected to the site's main page
everything disappears and even in the 'Session State' section of the
tracing no session or values are reported.

Is there an explanation for such a behaviour ?
Two possibilities spring to mind:

1) Are the login page and the main page both in the same site / application?

2) Is there any code which could be clearing out the Session variables, e.g.
Session.Remove(), Session.Abandon() etc?
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Nov 4 '08 #2
Well, you were right, thank you. In effect I tried to delete a
Session.Abandon row several hours ago and it didn't work.
I repetead the operation after your post and now the Sessions appear
correctly... By the way I also added a <sessionstate tag in the web.config.
Probably the fact it lacked was the reason why the sessions did not work.

"Mark Rae [MVP]" <ma**@markNOSPAMrae.netha scritto nel messaggio
news:%2***************@TK2MSFTNGP06.phx.gbl...
Two possibilities spring to mind:

1) Are the login page and the main page both in the same site /
application?

2) Is there any code which could be clearing out the Session variables,
e.g. Session.Remove(), Session.Abandon() etc?

Nov 4 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Gonenc Ercan | last post: by
4 posts views Thread by abcd | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.