Solved

Session get destroyed randomly

Posted on 2010-11-21
5
242 Views
Last Modified: 2012-05-10
Hello,

I have a web app that uses session for user authenticating, I store the logged in user's username and a specific level. I use the session_start() in every page before any content starts. Upon first login  user get redirected to a page which has some links to specific categories and user can go to each categories by clicking on link. So the issue is sometimes user get redirected again to the login screen because the session is destroyed. I used print_r($_SESSION); through out the site to see if the session is getting removed and some sometimes it return array() no session data at all.

I'm on a shared hosting environment.

Any idea what is happening ?

Thanks in advance.
0
Comment
Question by:sahanz
  • 2
5 Comments
 
LVL 6

Expert Comment

by:CyberGhost
Comment Utility
if you have AJAX calls and use cookies to store your session, it is possible that your cookies get timed out

AJAX calls - to the best of my knowledge - do not work with cookies, so once the session is regenerated, it won't be updated in the browser (cookie) and so the session will be invalidated
0
 
LVL 1

Author Comment

by:sahanz
Comment Utility
uhmm no ajax stuff.
0
 
LVL 1

Accepted Solution

by:
sahanz earned 0 total points
Comment Utility
It was a domain issue, the website had links with www. and without. Its fixed now and didnt get the issue after that.

Thanks
0
 
LVL 16

Expert Comment

by:CWS (haripriya)
Comment Utility
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now