1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Cookie session

Discussion in 'Programming' started by Daoud_Alpha, Aug 22, 2010.

  1. #1
    Hello

    i am a litter new to coldfusion, I have just finish my first web site (using CF8 and MySql5)

    My hosting server doesn’t enable session on CF8 plans (only on CF9)

    I want to login users securely so they can edit or delete their Add

    So I am obliged to upgrade to CF9 or use cookie session instead of CF or J2EE session

    If any one has an idea how to login user using cookie session
    If is it possible to give example code

    Thank you very much
     
    Daoud_Alpha, Aug 22, 2010 IP
  2. cfStarlight

    cfStarlight Peon

    Messages:
    398
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    What does your previous login code look like? Because generally the concept would be the same for cookies. Only the scope would change. ie use COOKIE instead of SESSION.
     
    cfStarlight, Aug 25, 2010 IP
  3. unknownpray

    unknownpray Active Member

    Messages:
    3,831
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    70
    #3
    Its better to contact with your hosting server he can guide you in good manners.
     
    unknownpray, Sep 14, 2010 IP
  4. Daoud_Alpha

    Daoud_Alpha Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    thank u
    finally i did it with CF session without need of J2EE session but with the same functionality of J2EE session:

    <cfset this.name="xxxxxxxx">
    <cfset this.sessionmanagement="true">
    <cfset this.sessiontimeout=#CreateTimeSpan(0,0,25,0)#>
    <cfset this.setClientCookies = "false">

    and then on OnSessionStart:

    <cffunction
    name="OnSessionStart"
    access="public"
    returntype="void"
    output="false"

    <cfcookie name="CFID" value="#SESSION.CFID#" />
    <cfcookie name="CFTOKEN" value="#SESSION.CFTOKEN#" />
    <cfreturn />
    </cffunction>

    so its like J2EE session; there is no cookie stored on client, when closing browser automatically loug out .....
     
    Daoud_Alpha, Dec 15, 2010 IP
  5. cfStarlight

    cfStarlight Peon

    Messages:
    398
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Yes it is stored on the client. It's just not a permanent cookie.
     
    cfStarlight, Dec 15, 2010 IP
  6. Daoud_Alpha

    Daoud_Alpha Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    yes, and that just what i wanted, i think its stored in browser memory, when you close browser the cookie deleted
     
    Daoud_Alpha, Dec 16, 2010 IP
  7. cfStarlight

    cfStarlight Peon

    Messages:
    398
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Yup. That's exactly what happens.
     
    cfStarlight, Dec 16, 2010 IP
  8. prptl709

    prptl709 Guest

    Messages:
    83
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    If I want to make the session for long time then what to do?
     
    prptl709, Feb 25, 2011 IP
  9. rockeerz

    rockeerz Active Member

    Messages:
    145
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #9
    its not a permanet cookie
     
    rockeerz, Jun 8, 2011 IP
  10. andrewhoward123

    andrewhoward123 Active Member

    Messages:
    149
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    50
    #10
    You can create your session with $_SESSION['user'];
     
    andrewhoward123, Jan 29, 2013 IP