CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2008
    Posts
    2

    Using the Session scalar array?

    For one, I've never used it before, but considering I'm going to create a login system for administration on my site, I'll need to.

    Session variables follow when the referrer is the same site?

    I'm just not grasping on the concept.

    By the way, I'm not formally trained, and quite young for a programmer/dev.

  2. #2
    Join Date
    May 2002
    Posts
    10,943

    Re: Using the Session scalar array?

    Session variables are only accessible by the web server which creates them. All sessions should have an ID or name assigned to them that way the separate sessions can be tracked. Then, you don't have to worry about session stealing.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  3. #3
    Join Date
    Sep 2008
    Posts
    3

    Re: Using the Session scalar array?

    Yes, ensure that you have a good schematic for your session handling as well. You may want to make a session wrapper to ensure each opened session variable is handled properly.

    (a little abstract, but thought it may be useful when creating this instead of waiting down the road when you have 800 session variables being set and destroyed in 700 different files )
    http://www.webdevxchange.com - Software Development Support Forum.

    http://www.GotHosting.org - Get 1 month free trial.

  4. #4
    Join Date
    Oct 2008
    Location
    Tel Aviv, Berlin, L.A.
    Posts
    23

    Re: Using the Session scalar array?

    Simply create a class (something like "mySession.class.php"), that holds appropriate members as well as methods that access those members. You, then, may decide to persist all that info in a db or just handle them (the infos) in memory. Which way ever, if you take an OO approach you don't need to worry about Cookies, IDs, tracking, and so on. Just have a "check-up-script" ready on top of EACH page call - could even be a FUNCTION that checks for existence/non-existence of your session class being instantiated or not... And you're safe.
    ariell
    programming is understanding

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured