Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

PHP Session Forcing it to use cookies

Posted on 2004-03-24
1
Medium Priority
?
199 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 200 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

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

636 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