Solved

PHP Session Forcing it to use cookies

Posted on 2004-03-24
1
195 Views
Last Modified: 2012-05-04
Is there a way to force a PHP session to use cookies as opposed to just passing around the session id?  I'm not the administrator of the server, so i'm looking for a solution i can do right out of the php code.  

0
Comment
Question by:ldsnerd
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 1

Accepted Solution

by:
j_chakraverty earned 50 total points
ID: 10672849
[1] method 1
set a cookie using a php header function
example
header(cookiename=cookievalue, expires= saturday, 05-feb-00 22:03:38 GMT; path=/;domain=yourdomain.com);

[2] method 2 recommended is using set cookie
example
setcookie( "variable name", "variable value", time()+3600. "/", "domain name",o);

check out php help for setcookie u can delete a cookie by same function and no value setcookie("variable name")
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn how to dynamically set the form action using jQuery.
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 …

687 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