1 Replies - 6780 Views - Last Post: 28 February 2011 - 07:26 AM

#1 bukatin   User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 28
  • Joined: 19-January 11

jquery session check

Posted 28 February 2011 - 12:20 AM

Hi,

How can i use jquery to check if session exist? this is the scenario,

I want to put this line "<div id="something">blahblah</div>" at the bottom part of my html when there is no session yet or sessions are not set like the session for the username and password. I'm using php.
Is This A Good Question/Topic? 0
  • +

Replies To: jquery session check

#2 RudiVisser   User is offline

  • .. does not guess solutions
  • member icon

Reputation: 1010
  • View blog
  • Posts: 3,566
  • Joined: 05-June 09

Re: jquery session check

Posted 28 February 2011 - 07:26 AM

You can just check for existence of PHPSESSID, but this won't tell you if it's a valid session or not.. You can't see the values of the session via Javascript, they're server-side only so this could only be done with AJAX or by echoing out your Javascript from PHP based on a condition.

This post has been edited by RudiVisser: 28 February 2011 - 07:27 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1