session_start not firing

Discussion in 'ASP General' started by Joe Befumo, Feb 13, 2006.

  1. Joe Befumo

    Joe Befumo Guest

    I'm workinbg in Visual Studio 2003. I'm experimenting with creating a
    session variable, and from all I can gather. the Session_Start event is not
    firing.

    In Global.asx.vb, in the Session Start event, I have the following:

    Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
    ' Fires when the session is started
    Session("varTest") = "123"
    End Sub

    First off, when I set a break point at that line, it is never reached when
    the application starts. Secondly, when I try to post a test alert(), to
    display Session("varTest"), it comes up blank (no error). Finally, if I set
    Session("varTest") = "123" in my asp page, then display it, it shows up, all
    of which leads me to believe that the global.asax file is not seen by the
    project, even though it was inserted automatically.

    Anyone have any idea how to rectify this problem?

    Thanks.

    Joe
    http://www.befumo.com





    --
    Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
    ------->>>>>>http://www.NewsDemon.com<<<<<<------
    Unlimited Access, Anonymous Accounts, Uncensored Broadband Access
    Joe Befumo, Feb 13, 2006
    #1
    1. Advertising

  2. Joe Befumo wrote:
    > First off, when I set a break point at that line, it is never reached
    > when the application starts. Secondly, when I try to post a test
    > alert(), to display Session("varTest"), it comes up blank (no error).
    > Finally, if I set Session("varTest") = "123" in my asp page, then
    > display it, it shows up, all of which leads me to believe that the
    > global.asax file is not seen by the project, even though it was
    > inserted automatically.
    > Anyone have any idea how to rectify this problem?


    Yes: Use Global.asa

    ASP and ASP.NET do not share sessions.



    --
    Dave Anderson

    Unsolicited commercial email will be read at a cost of $500 per message. Use
    of this email address implies consent to these terms. Please do not contact
    me directly or ask me to contact you directly for assistance. If your
    question is worth asking, it's worth posting.
    Dave Anderson, Feb 13, 2006
    #2
    1. Advertising

  3. Joe Befumo wrote:
    > I'm workinbg in Visual Studio 2003. I'm experimenting with creating a
    > session variable, and from all I can gather. the Session_Start event
    > is not firing.
    >
    > In Global.asx.vb, in the Session Start event, I have the following:


    There was no way for you to know it, but this is a classic asp newsgroup.
    While you may be lucky enough to find a dotnet-savvy person here who can
    answer your question, you can eliminate the luck factor by posting your
    question to a newsgroup where the dotnet-savvy people hang out. I suggest
    microsoft.public.dotnet.framework.aspnet.

    >
    > Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
    > ' Fires when the session is started
    > Session("varTest") = "123"
    > End Sub
    >
    > First off, when I set a break point at that line, it is never reached
    > when the application starts. Secondly, when I try to post a test
    > alert(), to display Session("varTest"), it comes up blank (no error).
    > Finally, if I set Session("varTest") = "123" in my asp page, then
    > display it, it shows up, all of which leads me to believe that the
    > global.asax file is not seen by the project, even though it was
    > inserted automatically.
    >
    > Anyone have any idea how to rectify this problem?
    >

    You've probably failed to use IIS Manager to create an application in your
    virtual directory.
    http://msdn2.microsoft.com/en-us/library/ha2y9493.aspx

    Bob Barrows
    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
    Bob Barrows [MVP], Feb 13, 2006
    #3
  4. Joe Befumo wrote:
    > Finally, if I set Session("varTest") = "123" in my asp page, then


    Oh! I missed the fact that you were trying to read this session variable in
    an "asp" page. Was that a typo? Did you actually mean "aspx"? If not, read
    Dave's reply.

    Bob Barrows

    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
    Bob Barrows [MVP], Feb 13, 2006
    #4
  5. Bob Barrows [MVP] wrote:
    > There was no way for you to know it, but this is a classic
    > asp newsgroup...
    >>
    >> First off, when I set a break point at that line, it is never reached
    >> when the application starts. Secondly, when I try to post a test
    >> alert(), to display Session("varTest"), it comes up blank (no error).
    >> Finally, if I set Session("varTest") = "123" in my asp page, then

    ^^^^^^^^^^^^^^
    Looks like ASP to me, Bob. At least in part.



    --
    Dave Anderson

    Unsolicited commercial email will be read at a cost of $500 per message. Use
    of this email address implies consent to these terms. Please do not contact
    me directly or ask me to contact you directly for assistance. If your
    question is worth asking, it's worth posting.
    Dave Anderson, Feb 13, 2006
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alvin Bruney [ASP.NET MVP]

    Re: Session_Start() event not firing...

    Alvin Bruney [ASP.NET MVP], Mar 7, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    558
    Alvin Bruney [ASP.NET MVP]
    Mar 7, 2005
  2. Joe Befumo

    session_start not firing . . .

    Joe Befumo, Feb 13, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    5,811
    George Ter-Saakov
    Feb 13, 2006
  3. Alex
    Replies:
    6
    Views:
    836
  4. Mike
    Replies:
    2
    Views:
    403
  5. greg
    Replies:
    5
    Views:
    929
Loading...

Share This Page