SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    May 2008
    Posts
    56
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Best practice for keeping state?

    Currently a logged in user on my site will be identifed by php session variables. But now i'm working on a ajax login and was wondering what's the best way to go about showing a logged in status using javascript? I was thinking about creating a cookie on the client side for this but then i'd have the session + a cookie and that doesn't seem like the best way to go about it. I also thought to go to cookies altogether and get rid of the session so i would have only one location to get info from.

    anyone know of "the way" to go about this?

    thanks!

  2. #2
    SitePoint Wizard silver trophy kyberfabrikken's Avatar
    Join Date
    Jun 2004
    Location
    Copenhagen, Denmark
    Posts
    6,157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sessions are usually maintained through a cookie, holding the session-id. Thus the xmlhttprequest should stay within the current session.


Bookmarks

Posting Permissions

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