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.

asp use session to keep User login

Discussion in 'C#' started by qq2, Jun 23, 2009.

  1. #1
    Hi, i need some help on my asp project

    the user login, i use session to keep ur pwd, and the user name is passing with the url. so everytime i'll check the session("pwd") ,if empty,then back to login page. so can protect that user save the url and enter in without key in password.
    SEMrush
    but i feel it's quite trouble. the session will be clear after some duration.is there anyway to refresh it everytime?
    or please teach me the best way for asp to doing the user login tracking. thanks a lot.
     
    qq2, Jun 23, 2009 IP
    SEMrush
  2. dopanel.com

    dopanel.com Peon

    Messages:
    94
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Cookies & Session
    I usually used Session to keep the status.If visitor don't have any activity in 20 minutes ,then the session will empty by IIS.
    Cookies is saved in visitor's computer. It also will expire if visitor don't have any activity in some time.

    The expire time of session & cookies can be config in your asp script.
     
    dopanel.com, Jun 24, 2009 IP
  3. thewebhostingdir

    thewebhostingdir Well-Known Member

    Messages:
    3,850
    Likes Received:
    84
    Best Answers:
    0
    Trophy Points:
    165
    #3
    Sessions are most used for login protected pages. Moreover, if you want to support "Remember Me" kind of logins then you need to use the browser based cookies.
     
    thewebhostingdir, Jun 24, 2009 IP
  4. DoDo Me

    DoDo Me Peon

    Messages:
    2,258
    Likes Received:
    27
    Best Answers:
    0
    Trophy Points:
    0
    #4
    don't use session, waste memory, lower server performance and limited your code in one server, you cannot have server load balance on session

    use cookie instead. save a key in cookie based on user(IP), username and saved in database as well, every time do a recalculation for authorization
     
    DoDo Me, Jun 24, 2009 IP
  5. Social.Network

    Social.Network Member

    Messages:
    519
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    35
    #5
    Load balancing systems support sticky-IP based sessions. Also, I agree that session-based state management is not ideal. If you MUST use the session, keep it lite and use a session wrapper class to limit the number of items.
     
    Social.Network, Jun 24, 2009 IP
  6. paulv200

    paulv200 Peon

    Messages:
    32
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Cookie log in has more possiblilities as you can do things like allowing the user to automatically log in, however, I always use sessions and have had no real issues with it.
     
    paulv200, Jun 27, 2009 IP
  7. thewebhostingdir

    thewebhostingdir Well-Known Member

    Messages:
    3,850
    Likes Received:
    84
    Best Answers:
    0
    Trophy Points:
    165
    #7
    Server RAM is not a problem at this time. Servers with More RAM are just going to be more cheaper day by day. Hence, if you practice to use session, you will not have any problem. Moreover, as Social.Network has told, you can use session wrapper.
     
    thewebhostingdir, Jun 28, 2009 IP
  8. rahulwb

    rahulwb Peon

    Messages:
    32
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    r u using ASP or ASP.NET?
     
    rahulwb, Jul 2, 2009 IP
  9. qq2

    qq2 Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    sorry for not online for long time. cause suddenly switch to another project. thanks for all of u's reply.i'm working on ASP. now i used session for it. cause it's faster way for me right now.it's for company information tracking site. customer don't want remember me function. so think cookies is not suitable. .any way. thanks for all of you...
     
    qq2, Jul 5, 2009 IP
  10. selinangela

    selinangela Peon

    Messages:
    35
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Cookie log in has more possiblilities as you can do things like allowing the user to automatically log in, however, I always use sessions and have had no real issues with it.
     
    selinangela, Jul 10, 2009 IP