Ask a Question related to ASP, Design and Development.

  1. #1

    Default session

    Hi,

    Could somebody please tell me how I check whether a session is dead based
    soley on the Session.SessionID.
    At present the timeout is set to 20 minutes in IIS, I am aware that I can
    reset this on the page. However after 22 minutes, or some interval longer
    than the session timeout, the Session.SessionID values is still availible.

    What I want to achieve is this. There is a small section of my site that
    must have an active session. When a user enteres this part of the site I
    must check if the session is still active because I am going to want to
    create variable in the sesion object. If the session is dead, I have to
    figure out how I am going to handle this,
    Can anybody suggest how to do this?? I am thinking I could either bring the
    session back to life, is this possible?? or use some sort of client side
    script to open a new window.

    cheers

    martin.


    David B Guest

  2. Similar Questions and Discussions

    1. #16263 [Com]: session.start() create new empty session file and not resume existing session
      ID: 16263 Comment by: pat at burnttech dot com Reported By: kur at natur dot cuni dot cz Status: No Feedback...
    2. #25307 [Ver->Csd]: Crash when session.serialize_handler=wddx & session, post, get vars
      ID: 25307 Updated by: sniper@php.net Reported By: cristea at pntcd dot ro -Status: Verified +Status: ...
    3. #25307 [Ver]: Crash when session.serialize_handler=wddx & session, post, get vars
      ID: 25307 User updated by: cristea at pntcd dot ro Reported By: cristea at pntcd dot ro Status: Verified Bug Type: ...
    4. #25307 [NEW]: Crash when session.serialize_handler=wddx & session, post, get vars
      From: cristea at pntcd dot ro Operating system: any PHP version: 4CVS-2003-08-29 (stable) PHP Bug Type: Session related Bug...
  3. #2

    Default Re: session

    "David B" <david1234@yahoo.com> wrote in message
    news:%23DlikkUYDHA.1640@TK2MSFTNGP10.phx.gbl...
    > Hi,
    >
    > Could somebody please tell me how I check whether a session is dead
    based
    > soley on the Session.SessionID.
    > At present the timeout is set to 20 minutes in IIS, I am aware that I can
    > reset this on the page. However after 22 minutes, or some interval longer
    > than the session timeout, the Session.SessionID values is still availible.
    A new ID will be created.
    >
    > What I want to achieve is this. There is a small section of my site that
    > must have an active session.
    The user will have an active session if he hits your site, even if that
    section is the first place he goes.
    > When a user enteres this part of the site I
    > must check if the session is still active because I am going to want to
    > create variable in the sesion object. If the session is dead, I have to
    > figure out how I am going to handle this,
    > Can anybody suggest how to do this?? I am thinking I could either bring
    the
    > session back to life, is this possible??
    It happens on its own by the user hitting the server.

    What is it that you really want to do? What is it that makes you need what
    you describe?

    Ray at home


    Ray at Guest

  4. #3

    Default Re: session

    Ray, Cheers for the (exceptionally quick) reply,

    This is the senariono, A user goes to my site and initially we are not
    concernecd with sessions.
    They then go onto a booking section. This booking section stores all
    information in a database.
    When a user starts a booking a new record is stored in the database with a
    PK (integer) this PK is stored in a session variable (session("ID") so that
    the user on the site can always connect to their required records in the
    database.
    However if the session expires then session("ID") is not availible.

    At this point I want to tell the user that their session has expired.

    However, the following code ALWAYS tells me the Session("ID") is numeric,
    even if it does not exist.

    if ISNUMERIC(Session("ID")) then
    Response.Write("Session('ID') is numeric -- it is Alive -- session ID is
    ")
    else
    Response.Write("Session('ID') is not numeric -- it is dead") end if

    I guess what I am asking in a nutshell is how I tell if the sesion has
    expired.

    Or maybe ISNUMERIC has a bug, returning true when the Session("ID") is
    clearly empty ...:)

    There are two different senarios for checking if the session has expired.

    1. The user has not been assigned a session("ID") yet --- This seems to be
    the most difficult case,

    2. They are midway through the process, they have already been assigned a
    session ID but the session has expired.

    cheers

    martin.


    "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
    news:uuPb7tUYDHA.1872@TK2MSFTNGP12.phx.gbl...
    > "David B" <david1234@yahoo.com> wrote in message
    > news:%23DlikkUYDHA.1640@TK2MSFTNGP10.phx.gbl...
    > > Hi,
    > >
    > > Could somebody please tell me how I check whether a session is dead
    > based
    > > soley on the Session.SessionID.
    > > At present the timeout is set to 20 minutes in IIS, I am aware that I
    can
    > > reset this on the page. However after 22 minutes, or some interval
    longer
    > > than the session timeout, the Session.SessionID values is still
    availible.
    >
    > A new ID will be created.
    >
    > >
    > > What I want to achieve is this. There is a small section of my site that
    > > must have an active session.
    >
    > The user will have an active session if he hits your site, even if that
    > section is the first place he goes.
    >
    > > When a user enteres this part of the site I
    > > must check if the session is still active because I am going to want to
    > > create variable in the sesion object. If the session is dead, I have to
    > > figure out how I am going to handle this,
    > > Can anybody suggest how to do this?? I am thinking I could either bring
    > the
    > > session back to life, is this possible??
    >
    > It happens on its own by the user hitting the server.
    >
    > What is it that you really want to do? What is it that makes you need
    what
    > you describe?
    >
    > Ray at home
    >
    >

    David B Guest

  5. #4

    Default Re: session

    In article <#DlikkUYDHA.1640@TK2MSFTNGP10.phx.gbl>, [email]david1234@yahoo.com[/email]
    says...
    > Could somebody please tell me how I check whether a session is dead based
    > soley on the Session.SessionID.
    I don't think that changes until the browser closes.
    > What I want to achieve is this. There is a small section of my site that
    > must have an active session. When a user enteres this part of the site I
    > must check if the session is still active because I am going to want to
    > create variable in the sesion object.
    I test a session variable that I know should be available:

    If session("userId") = "" Then
    figure out what to do
    End If
    > If the session is dead, I have to figure out how I am going to
    > handle this...
    I have the luxury of requiring my users to use IE6, so I use cookies. I
    even have a class that figures out for itself if it needs to reload from
    the cookies. Here's a short example:

    Private Sub Class_Initialize( )

    If session("FirstName") = "" Then
    'Session must have expired - reload from the cookies
    session("FirstName") = Request.Cookies ("User")("FName")
    ...
    session("Rank") = Request.Cookies ("User")("UserRank")
    End If

    m_firstName = session("FirstName")
    ...
    m_userRank = session("Rank")

    End Sub


    -- Rick
    Guinness Mann Guest

  6. #5

    Default Re: session

    Thank you all for the input.

    I am now a lot clearer on when and how a session expires.

    cheers

    dave.


    "Guinness Mann" <GMann@dublin.com> wrote in message
    news:MPG.19a419506a7cab40989696@news.newsguy.com.. .
    > In article <#DlikkUYDHA.1640@TK2MSFTNGP10.phx.gbl>, [email]david1234@yahoo.com[/email]
    > says...
    > > Could somebody please tell me how I check whether a session is dead
    based
    > > soley on the Session.SessionID.
    >
    > I don't think that changes until the browser closes.
    >
    > > What I want to achieve is this. There is a small section of my site that
    > > must have an active session. When a user enteres this part of the site I
    > > must check if the session is still active because I am going to want to
    > > create variable in the sesion object.
    >
    > I test a session variable that I know should be available:
    >
    > If session("userId") = "" Then
    > figure out what to do
    > End If
    >
    > > If the session is dead, I have to figure out how I am going to
    > > handle this...
    >
    > I have the luxury of requiring my users to use IE6, so I use cookies. I
    > even have a class that figures out for itself if it needs to reload from
    > the cookies. Here's a short example:
    >
    > Private Sub Class_Initialize( )
    >
    > If session("FirstName") = "" Then
    > 'Session must have expired - reload from the cookies
    > session("FirstName") = Request.Cookies ("User")("FName")
    > ...
    > session("Rank") = Request.Cookies ("User")("UserRank")
    > End If
    >
    > m_firstName = session("FirstName")
    > ...
    > m_userRank = session("Rank")
    >
    > End Sub
    >
    >
    > -- Rick

    David B Guest

  7. #6

    Default session

    Bonjour,

    quand j'utilise header apres une authentification pour redirection, je perds
    mes parametres de connexion.

    est ce normal ? que puis-je faire pour y remédier ? existe t il une autre
    commande qui me permetterai de faire la mm chose sans perdre mes parametres
    ?


    Merci pour vos lumieres.


    Pierre Guest

  8. #7

    Default Re: session


    "Pierre" <pfe_nospam@freesurf.fr> wrote in message
    news:bvqltb$cmg$1@biggoron.nerim.net...
    > Bonjour,
    >
    > quand j'utilise header apres une authentification pour redirection, je
    perds
    > mes parametres de connexion.
    >
    > est ce normal ? que puis-je faire pour y remédier ? existe t il une autre
    > commande qui me permetterai de faire la mm chose sans perdre mes
    parametres
    > ?
    >
    >
    > Merci pour vos lumieres.
    >
    >
    Pourquoi ne pas inclure les paramètres avec la redirection?

    header("Location: newpage.php?var1=value1&var2=value2");



    Guest

  9. #8

    Default Re: session

    en fait j'ai trouvé :

    il faut préciser en haut de chaque page start_session.

    et on récupere tout ce qu'on a stocké

    <xyzzy> a écrit dans le message de
    news:wpWdnbsvSq_GmrzdRVn-hw@comcast.com...
    >
    > "Pierre" <pfe_nospam@freesurf.fr> wrote in message
    > news:bvqltb$cmg$1@biggoron.nerim.net...
    > > Bonjour,
    > >
    > > quand j'utilise header apres une authentification pour redirection, je
    > perds
    > > mes parametres de connexion.
    > >
    > > est ce normal ? que puis-je faire pour y remédier ? existe t il une
    autre
    > > commande qui me permetterai de faire la mm chose sans perdre mes
    > parametres
    > > ?
    > >
    > >
    > > Merci pour vos lumieres.
    > >
    > >
    > Pourquoi ne pas inclure les paramètres avec la redirection?
    >
    > header("Location: newpage.php?var1=value1&var2=value2");
    >
    >
    >

    Pierre Guest

  10. #9

    Default Session

    I have a web project, and I am using the session variable. On rare
    occasions, a user of my web site will call and tell me they can see another
    users account information. This is, to say the least disturbing. I can not
    seem to duplicate the problem. Has any one else heard of experienced this
    issue?

    thanks

    Phil.


    Phil Barber Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139