473,382 Members | 1,409 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

How safe are cookies?

348 100+
I need to direct users that are logged in to a sub domain. I guess the absolute only way is with a cookie to carry the session variable.

I have heard that using cookies opens the door to xss. Are cookies the best way to go? Security has to be put first on this project.

Any thoughts would be appriciated.

Thanks,

Frank
Jun 24 '08 #1
3 1612
realin
254 100+
storing a session id, not very sure if it opens a loop hole or no
But for safety u can use an algorithm to secure ur session ID,
and concatenate a secret key with the session ID

Expand|Select|Wrap|Line Numbers
  1.  
  2. base64(sessionid+special character+secret key)
  3. and decode it when u have secret key 
  4.  
you can do lotsa stuff to secure the session id while it lies in cookie and delete it when its done :)
Jun 24 '08 #2
fjm
348 100+
storing a session id, not very sure if it opens a loop hole or no
But for safety u can use an algorithm to secure ur session ID,
and concatenate a secret key with the session ID

Expand|Select|Wrap|Line Numbers
  1.  
  2. base64(sessionid+special character+secret key)
  3. and decode it when u have secret key 
  4.  
you can do lotsa stuff to secure the session id while it lies in cookie and delete it when its done :)
Hey Realin, thanks for the advice. I was able to find a little info googling. I have always avoided cookies because I never cared for them but now I find myself in a position where I need to use them.

Your example is exactly what I have done. Hopefully all will be ok. :)

Thanks!

Frank
Jun 25 '08 #3
realin
254 100+
its always great to see things getting worked :)
Jun 26 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: FLEB | last post by:
I've been trying to find a way to transfer session data (login information and such) between different domains, both on the same shared host. I think (I haven't tested yet, though) that using the...
4
by: Brian Burgess | last post by:
Hi all, Anyone know of any special issues with storing cookies with ASP? I'm trying this with two browsers: One is IE 6.0 with cookies set to 'prompt'. This has been working properly as any...
20
by: Brian Burgess | last post by:
Hi all, Anyone know if this is possible? If so, on which page would the cookie be? .. On the page calling a function defined in the include file? thanks in advance.. -BB
6
by: Mark | last post by:
Hi... I've come across some weird bug with Response.Cookies. Or maybe it will be called "by design" but for the life of me I can't figure out what purpose it would serve. If you're setting a...
0
by: Amit Jamgade | last post by:
Hi, I am making use of cookies to store the Session State information through JavaScript as given below in an ASP Page. Suppose I have XYZ.asp page. The code in this page goes as shown below....
6
by: Stephane | last post by:
Hi, I have a login page where if the user wants his access codes to be saved are set into a cookie. In the logout page, I want to delete those cookies. I tried this and this is not working at...
4
by: romayankin | last post by:
I need to limit the session time for a particular user who is working on my site. I'd also like to extend the session time each time user performs some action (moves from one page to another). I've...
7
by: monomaniac21 | last post by:
hi i have a php site which allows users to save a cookie on their computer which stores their user id details and allows them to auto- login. i'm wondering whether this is safe, is it...
0
by: rn5a | last post by:
This is how I am creating & then reading cookies: <script runat="server"> Sub Page_Load(ByVal obj As Object, ByVal ea As EventArgs) 'create cookies Response.Cookies("UserName").Value = "Ron"...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.