Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Regular Coder
    Join Date
    Dec 2005
    Posts
    702
    Thanks
    0
    Thanked 0 Times in 0 Posts

    is needed the global.asa file for simple usage of session vars ?

    is needed the global.asa file for simple usage of session vars ?

  • #2
    Regular Coder
    Join Date
    Mar 2007
    Posts
    505
    Thanks
    1
    Thanked 19 Times in 19 Posts
    No. Session variables do not need the global.asa file.

    Global.asa is used mainly (although not entirely) for connectivity to Access, while session variables are kept in server's memory (which is why it is so important to destroy variables, connections, and sessions when page/applications are complete).

    HTH!
    Last edited by Daemonspyre; 06-29-2007 at 07:23 PM.
    To say my fate is not tied to your fate is like saying, 'Your end of the boat is sinking.' -- Hugh Downs
    Please, if you found my post helpful, pay it forward. Go and help someone else today.

  • #3
    Regular Coder
    Join Date
    Dec 2005
    Posts
    702
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Application vars may defined/declared outside the global.asa file [in a file of an application] ? This applys to find visitors in each webpage of an application [of 4 pages] ?

  • #4
    Regular Coder
    Join Date
    Mar 2007
    Posts
    505
    Thanks
    1
    Thanked 19 Times in 19 Posts
    You can use both session and application variables without the global.asa.

    Session variables and Application variables are only separated by who can see them -- session vars are only for a specific user (based on session ID), while application vars are available for everyone.
    To say my fate is not tied to your fate is like saying, 'Your end of the boat is sinking.' -- Hugh Downs
    Please, if you found my post helpful, pay it forward. Go and help someone else today.

  • #5
    Regular Coder
    Join Date
    Dec 2005
    Posts
    702
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Can you give me an example using application variables in an .asp file ? eg if I have a shopping cart and I want to see how many visitors currently active-non checkd-out yet, and visitors have checked out , how to immplement it ?

  • #6
    Regular Coder
    Join Date
    Mar 2007
    Posts
    505
    Thanks
    1
    Thanked 19 Times in 19 Posts
    What you are looking at doing with an Active User Counter DOES need a global.asa, because only there does it have the 4 event handlers that you need.

    However, application variables that you want to set for each user do not.

    For example: Titles on every page

    On your opening page (default.asp, index.asp. logon.asp, etc...)

    Code:
    <% application("strTitle") = "This is lse123's Shopping Cart" %>
    
    <html>
    <head>
    <title><%= application("strTitle") %></title>
    </head>
    <body>
    ...
    ...
    </body>
    </html>
    Every other page should have <title><%= application("strTitle") %></title>. That way, all of your pages have the same title and it only needs to be changed in one place.

    As to Active User counters, check out ASP 101's Active User Counter.
    To say my fate is not tied to your fate is like saying, 'Your end of the boat is sinking.' -- Hugh Downs
    Please, if you found my post helpful, pay it forward. Go and help someone else today.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •