Skip to main content
Known Participant
May 28, 2006
質問

Application Variable in ASP

  • May 28, 2006
  • 返信数 2.
  • 334 ビュー
Afternoon all, Would be grateful if you could confirm, or correct below - I know how to set a session variable in ASP, in the example below i'm trying to set EMPLOYERID to the value of 2

<%Session("EMPLOYERID") = "2"%>

This works fine - for twenty minutes then the session dies and all hell breaks lose, with this in mind, i believe that i need to use a Application Variable instead and therefore was wondering whether the below is the correct way of setting an application variable -

<%Application("Employer") = "2"%>

Thanks for your help
このトピックへの返信は締め切られました。

返信数 2

Inspiring
May 28, 2006
If the session dies, you should redirect the user accordingly. eg

if Session("EmployerID")="" then Response.Redirect "login.asp"

You can't really use application variables, as they are the same for
everybody not individual users.

--
Jules
http://www.charon.co.uk/charoncart
Charon Cart 3
Shopping Cart Extension for Dreamweaver MX/MX 2004



Inspiring
May 28, 2006
Or you can change the timeout value of your session by adding

Session.Timeout = 60

to your code. Session value is in minutes so the above sets it to an hour.
.. and so on ..


--
Nancy Gill
Adobe Community Expert
BLOG: http://www.dmxwishes.com/blog.asp
Author: Dreamweaver 8 e-book for the DMX Zone
Co-Author: Dreamweaver MX: Instant Troubleshooter (August, 2003)
Technical Editor: DMX 2004: The Complete Reference, DMX 2004: A Beginner's
Guide, Mastering Macromedia Contribute
Technical Reviewer: Dynamic Dreamweaver MX/DMX: Advanced PHP Web Development


"GTN1707" <webforumsuser@macromedia.com> wrote in message
news:e5cbpt$a3$1@forums.macromedia.com...
> Afternoon all, Would be grateful if you could confirm, or correct below -
> I
> know how to set a session variable in ASP, in the example below i'm trying
> to
> set EMPLOYERID to the value of 2
>
> <%Session("EMPLOYERID") = "2"%>
>
> This works fine - for twenty minutes then the session dies and all hell
> breaks
> lose, with this in mind, i believe that i need to use a Application
> Variable
> instead and therefore was wondering whether the below is the correct way
> of
> setting an application variable -
>
> <%Application("Employer") = "2"%>
>
> Thanks for your help
>